import { runGroundedAnswer, type AnswerGeneratorInput, type KnowledgeStore } from "@oscharko-dev/keiko-local-knowledge";
import type { Chat, ChatLocalKnowledgeScope, LocalKnowledgeEvidenceCitation } from "@oscharko-dev/keiko-contracts/bff-wire";
import type { KnowledgeCapsule, RetrievalReference } from "@oscharko-dev/keiko-contracts";
import { type OpenAIEmbeddingAdapter } from "@oscharko-dev/keiko-model-gateway";
import type { UiHandlerDeps } from "./deps.js";
import type { RouteResult } from "./routes.js";
export declare const DEFAULT_REFERENCE_BUDGET = 10;
export declare const MAX_EXCERPT_CHARS = 900;
export declare const MAX_PROMPT_REFERENCES = 8;
interface AskInput {
    readonly chatId: string;
    readonly content: string;
    readonly modelId: string | undefined;
}
export interface SelectedLocalKnowledgeScope {
    readonly capsules: readonly KnowledgeCapsule[];
    readonly scopeKind: "capsule" | "capsule-set";
    readonly scopeLabel: string;
}
export type LocalKnowledgeCitationSourceLookup = (reference: RetrievalReference) => string | undefined;
export declare function openStoreForDeps(deps: UiHandlerDeps): {
    readonly store: KnowledgeStore;
    close(): void;
};
export declare function createEmbeddingAdapter(deps: UiHandlerDeps, modelIds: readonly string[]): OpenAIEmbeddingAdapter | RouteResult;
export declare function selectedCapsulesForScope(scope: ChatLocalKnowledgeScope, store: KnowledgeStore): SelectedLocalKnowledgeScope | RouteResult;
export declare function scopeStateFailure(selected: SelectedLocalKnowledgeScope): {
    readonly reason: string;
    readonly message: string;
} | undefined;
export declare function renderCitationLabel(citation: AnswerGeneratorInput["references"][number]["citation"]): string;
export declare function buildSelectedScopeSourceLookup(store: KnowledgeStore, selected: SelectedLocalKnowledgeScope): LocalKnowledgeCitationSourceLookup;
export declare function projectLocalKnowledgeCitation(reference: RetrievalReference, marker: string, sourceLookup?: LocalKnowledgeCitationSourceLookup): LocalKnowledgeEvidenceCitation;
export declare function enforcedNoEvidenceReason(result: Awaited<ReturnType<typeof runGroundedAnswer>>): string | undefined;
export declare function buildLocalKnowledgeCitations(result: Awaited<ReturnType<typeof runGroundedAnswer>>, noEvidenceReason: string | undefined, sourceLookup?: LocalKnowledgeCitationSourceLookup): readonly LocalKnowledgeEvidenceCitation[];
export declare function handleLocalKnowledgeGroundedAsk(chat: Chat, input: AskInput, deps: UiHandlerDeps, signal: AbortSignal): Promise<RouteResult>;
export {};
//# sourceMappingURL=local-knowledge-grounded-qa.d.ts.map