/** * @fileoverview AI-powered Entity Document template suggestion engine. * * Uses the "Entity Document Suggestion" AI prompt to analyze entity schemas * and suggest optimal Nunjucks templates for duplicate detection, search, * or classification use cases. * * @module @memberjunction/ai-vector-sync */ import { IMetadataProvider, UserInfo } from '@memberjunction/core'; /** Supported use cases for document suggestion */ export type DocumentSuggestionUseCase = 'duplicate detection' | 'search' | 'classification'; /** A relationship descriptor passed to the AI prompt */ export interface RelationshipDescriptor { Name: string; RelatedEntity: string; Fields: string[]; ForeignKeyField: string; } /** A field descriptor passed to the AI prompt */ export interface FieldDescriptor { Name: string; Type: string; IsPrimaryKey: boolean; IsUnique: boolean; MaxLength: number | null; AllowsNull: boolean; Description: string; } /** The structured JSON response from the AI prompt */ export interface DocumentSuggestionResult { template: string; selectedFields: string[]; selectedRelationships: { name: string; fields: string[]; }[]; potentialMatchThreshold: number; absoluteMatchThreshold: number; reasoning: string; } /** Full response from the suggestion engine */ export interface SuggestDocumentResponse { Success: boolean; ErrorMessage: string; Suggestion: DocumentSuggestionResult | null; } /** * Suggests Entity Document templates by analyzing entity schemas with AI. * * Uses the `AIPromptRunner` directly (not via Actions) per CLAUDE.md design philosophy. */ export declare class EntityDocumentSuggester { /** Optional provider override; falls back to Metadata.Provider when not set. */ private _provider?; /** Returns the active provider — explicit override if set, otherwise the global default. */ protected get ProviderToUse(): IMetadataProvider; /** * Analyze an entity's schema and suggest an Entity Document template. * * @param entityName - The name of the entity to analyze * @param useCase - The intended use case (defaults to 'duplicate detection') * @param contextUser - The authenticated user context * @returns A suggestion with template, selected fields, and threshold recommendations */ SuggestDocument(entityName: string, useCase: DocumentSuggestionUseCase, contextUser: UserInfo): Promise; /** Resolve entity metadata by name */ private resolveEntity; /** Build field descriptors from entity metadata */ private buildFieldDescriptors; /** Build relationship descriptors from entity metadata */ private buildRelationshipDescriptors; /** Find the suggestion prompt from AIEngine */ private findSuggestionPrompt; /** Execute the AI prompt and parse the response */ private executeSuggestionPrompt; } //# sourceMappingURL=EntityDocumentSuggester.d.ts.map