import type { EmbeddingService } from '../../ai/service'; import type { RdfEngineLike, RdfTextChunkInput, RdfTextSourceInput, RdfVectorSourceInput } from '../../storage/rdf/types'; import type { StoreContext } from '../chatkit/store'; import { type EmbeddingProviderFailureCategory } from '../../ai/service/EmbeddingProviderError'; export type RdfVectorIndexingSkippedReason = 'rdf_engine_unavailable' | 'vector_index_unavailable' | 'ai_config_unavailable' | 'embedding_model_unavailable' | 'text_source_unavailable' | EmbeddingProviderFailureCategory; export interface RdfSearchIndexingServiceOptions { rdfEngine?: Pick; store: { getAiConfig(context: StoreContext): Promise | RdfSearchAiConfig | undefined; }; embeddingService: Pick; maxChunks?: number; maxEmbeddingInputChars?: number; embeddingInputKinds?: RdfEmbeddingInputKind[]; projectionPolicyVersion?: string; summaryService?: RdfEmbeddingSummaryService; summaryPromptVersion?: string; } export interface RdfSearchAiConfig { providerId: string; baseUrl: string; proxyUrl?: string; defaultModel?: string; embeddingModel?: string; embeddingModelVersion?: string; apiKey: string; credentialId: string; } export interface IndexRdfVectorSourceInput { context?: StoreContext; embeddingConfig?: RdfSearchAiConfig; source: RdfTextSourceInput & RdfVectorSourceInput; text?: string; chunks?: RdfTextChunkInput[]; } export interface DeleteRdfVectorSourceInput { source: string; } export interface RebuildRdfVectorSourceInput { context?: StoreContext; embeddingConfig?: RdfSearchAiConfig; sourceKey: string; } export type RdfVectorIndexingResult = { status: 'indexed'; source: string; sourceHash?: string; sourceVersion?: string; providerId?: string; model?: string; modelVersion?: string; configFingerprint?: string; chunkCount: number; skippedInputs?: RdfSkippedEmbeddingInput[]; summarizedInputs?: RdfSummarizedEmbeddingInput[]; } | { status: 'skipped'; source: string; sourceHash?: string; sourceVersion?: string; reason: RdfVectorIndexingSkippedReason; providerId?: string; model?: string; modelVersion?: string; configFingerprint?: string; message?: string; } | { status: 'retryable'; source: string; sourceHash?: string; sourceVersion?: string; reason: EmbeddingProviderFailureCategory; providerId: string; model: string; modelVersion?: string; configFingerprint: string; message?: string; }; export interface RdfVectorDeleteResult { status: 'deleted' | 'skipped'; source: string; deletedChunks: number; reason?: 'rdf_engine_unavailable' | 'vector_index_unavailable'; } export type RdfEmbeddingInputKind = 'locator' | 'semantic'; export interface RdfSkippedEmbeddingInput { chunkKey: string; inputKind: RdfEmbeddingInputKind; reason: 'input_too_large' | 'summary_failed' | 'summary_too_large'; inputChars: number; maxChars: number; summaryChars?: number; message?: string; } export interface RdfEmbeddingSummaryRequest { content: string; inputKind: RdfEmbeddingInputKind; chunkKey: string; sourceHash?: string; maxChars: number; promptVersion: string; } export interface RdfEmbeddingSummaryResult { content: string; provider: string; model: string; promptVersion?: string; rounds?: number; } export interface RdfEmbeddingSummaryService { summarize(request: RdfEmbeddingSummaryRequest): Promise | RdfEmbeddingSummaryResult; } export interface RdfSummarizedEmbeddingInput { chunkKey: string; inputKind: RdfEmbeddingInputKind; originalChars: number; summaryChars: number; rounds: number; } export declare const DEFAULT_RDF_VECTOR_MODEL_VERSION = "unversioned"; export declare const DEFAULT_RDF_VECTOR_PROJECTION_POLICY_VERSION = "rdf-vector-projection-v1"; export declare function normalizeRdfVectorModelVersion(value: string | undefined): string; /** * Product-level bridge from Pod-owned AI credentials to the RDF vector index. * * CSS storage writes can keep text search sources current because they already * have the resource bytes. Vector writes need user Pod AI credentials, so they * live here at the product/service boundary instead of inside MixDataAccessor. */ export declare class RdfSearchIndexingService { private readonly options; constructor(options: RdfSearchIndexingServiceOptions); rebuildVectorSource(input: RebuildRdfVectorSourceInput): Promise; indexVectorSource(input: IndexRdfVectorSourceInput): Promise; deleteVectorSource(input: DeleteRdfVectorSourceInput): Promise; private sourceWithHash; private textChunks; private embeddingInputs; private embeddingInputKinds; private projectionPolicyVersion; private embeddingInputContent; private resolveEmbeddingInputBudget; private summarizeEmbeddingInput; private skippedEmbeddingInput; private indexedResult; private skippedResult; }