/**
 * Entity Schema Definitions for All Entity Types
 *
 * Defines entity schemas for all entity types including new financial types
 * from the finances repository.
 *
 * **Primary Usage:** Initialize schemas in the database via `npm run schema:init`
 * This makes schemas transparent and queryable in the database, and is the recommended
 * approach for production environments.
 *
 * **Fallback Usage:** These schemas are also used as runtime fallbacks when no schema
 * is registered in the database. This provides convenience during development but should
 * not be relied upon in production. See src/services/interpretation.ts for fallback logic.
 *
 * **Schema Initialization:**
 * Run `npm run schema:init` to register all schemas from this file into the
 * schema_registry database table. This ensures schemas are available in the database
 * and eliminates the need for runtime fallbacks.
 */
import type { SchemaDefinition, ReducerConfig } from "./schema_registry.js";
/**
 * Metadata for entity schemas
 * Contains human-readable labels, descriptions, categories, and aliases
 */
export interface EntitySchemaMetadata {
    label: string;
    description: string;
    category: "finance" | "productivity" | "knowledge" | "health" | "media" | "agent_runtime";
    aliases?: string[];
    primaryProperties?: string[];
    guest_access_policy?: "closed" | "read_only" | "submit_only" | "submitter_scoped" | "open";
}
export interface EntitySchema {
    entity_type: string;
    schema_version: string;
    metadata?: EntitySchemaMetadata;
    schema_definition: SchemaDefinition;
    reducer_config: ReducerConfig;
}
/**
 * Default entity schemas for all entity types
 * These are used as fallbacks when no schema is registered in the database.
 */
export declare const ENTITY_SCHEMAS: Record<string, EntitySchema>;
/**
 * @deprecated EXPANDED_ENTITY_SCHEMAS has been merged into ENTITY_SCHEMAS.
 * All schemas are now in a single unified structure.
 * This export is kept for backward compatibility but will be removed in a future version.
 */
export declare const EXPANDED_ENTITY_SCHEMAS: Record<string, Partial<EntitySchema>>;
/**
 * Get entity schema for an entity type
 */
export declare function getSchemaDefinition(entityType: string): EntitySchema | null;
/**
 * Resolve an extracted or localized entity type to a canonical entity_type
 * by matching against registered schemas' entity_type and metadata.aliases.
 * No hardcoded map: all mappings come from schema definitions, so new schemas
 * and aliases extend behavior automatically.
 * Matching is case- and accent-insensitive (e.g. "Recibo", "Récibo" -> receipt).
 *
 * @param extractedType - Raw type from LLM or client (e.g. "Recibo", "factura")
 * @returns Canonical entity_type if a schema matches, otherwise null
 */
export declare function resolveEntityTypeFromAlias(extractedType: string): string | null;
/**
 * Return all canonical entity types that have a registered schema.
 * Used e.g. for LLM-based entity type inference when no alias matches.
 */
export declare function getRegisteredEntityTypes(): string[];
/** Minimal schema shape for scoring (code-defined or registry entry). */
export interface SchemaCandidate {
    entity_type: string;
    schema_definition: {
        fields?: Record<string, {
            type: string;
            required?: boolean;
        }>;
    };
}
/**
 * Refine entity type using extracted field keys: if the current type fits poorly
 * (e.g. 0–1 required fields) and another schema fits better (e.g. 2+ required fields),
 * return the better-matching type. Reduces misclassification (e.g. receipt doc → note).
 *
 * Works with a dynamic number of schema types: pass candidateSchemas from the registry
 * (e.g. schemaRegistry.listActiveSchemas(userId)) merged with code-defined schemas so
 * user/global DB schemas participate. When candidateSchemas is omitted, only code-defined
 * ENTITY_SCHEMAS are considered.
 *
 * @param currentEntityType - Resolved type from alias/LLM
 * @param extractedFieldKeys - Keys from extracted entity data (e.g. Object.keys(fields))
 * @param candidateSchemas - Optional list of schemas to consider (code + DB); when omitted, uses ENTITY_SCHEMAS only
 * @returns Refined entity type, or currentEntityType if no better match
 */
export declare function refineEntityTypeFromExtractedFields(currentEntityType: string, extractedFieldKeys: string[], candidateSchemas?: SchemaCandidate[]): string;
/**
 * @deprecated Use getSchemaDefinition() instead. All schemas are now unified.
 * This function is kept for backward compatibility but will be removed in a future version.
 */
export declare function getExpandedSchemaDefinition(entityType: string): Partial<EntitySchema> | null;
//# sourceMappingURL=schema_definitions.d.ts.map