import { type ChatMessage as GatewayChatMessage } from "@oscharko-dev/keiko-model-gateway";
import type { ModelPort } from "@oscharko-dev/keiko-harness";
import { type ConnectedContextPack, type ExplorationBudget } from "@oscharko-dev/keiko-contracts/connected-context";
import { type ChatConnectedScope, type GroundedAnswerContextPackSummary } from "@oscharko-dev/keiko-contracts/bff-wire";
import type { RouteResult } from "./routes.js";
import type { Redactor, UiHandlerDeps } from "./deps.js";
import type { Chat } from "./store/index.js";
import { type OrchestratorInput, type RetrievalOnlyOutput } from "./grounded-orchestrator.js";
import { type GroundedAnswerPayload } from "./grounded-answer.js";
export declare function buildConnectedScopes(chat: Chat): readonly ChatConnectedScope[];
export declare function splitExplorationBudget(base: ExplorationBudget, n: number): ExplorationBudget;
export declare function sourceLabels(scopes: readonly ChatConnectedScope[]): readonly string[];
export declare function mergeContextPackSummaries(summaries: readonly GroundedAnswerContextPackSummary[]): GroundedAnswerContextPackSummary;
export interface LabeledPack {
    readonly label: string;
    readonly pack: ConnectedContextPack;
}
export declare function buildMultiSourceGatewayMessages(question: string, labeledPacks: readonly LabeledPack[], redactor: Redactor): readonly GatewayChatMessage[];
export type GroundedRetriever = (input: OrchestratorInput) => Promise<RetrievalOnlyOutput>;
export declare function defaultRetriever(signal: AbortSignal): GroundedRetriever;
export type MultiSourceAnswerer = (question: string, labeledPacks: readonly LabeledPack[]) => Promise<GroundedAnswerPayload>;
export declare function createMultiSourceAnswerer(model: ModelPort, modelId: string, redactor: Redactor, signal: AbortSignal): MultiSourceAnswerer;
export interface MultiSourceAskInput {
    readonly chat: Chat;
    readonly scopes: readonly ChatConnectedScope[];
    readonly content: string;
    readonly modelId: string;
    readonly deps: UiHandlerDeps;
    readonly retriever: GroundedRetriever;
    readonly answerer: MultiSourceAnswerer;
    readonly signal: AbortSignal;
}
export declare function runMultiSourceAsk(ctx: MultiSourceAskInput): Promise<RouteResult>;
//# sourceMappingURL=grounded-qa-multi-source.d.ts.map