import type { RouterDecision } from "./types.js"; export interface RouterConfig { /** Master switch. When false, every call returns `{route: "ALL"}`. */ enabled: boolean; /** Which engine fills the gap when heuristics are ambiguous. */ mode: "heuristic" | "jina-classifier"; /** Jina API key — required when mode === "jina-classifier". */ jinaApiKey?: string; /** * Optional few-shot classifier ID. When provided, the router calls * `/v1/classify` with this ID instead of running zero-shot. */ classifierId?: string; /** * Number of zero-shot classes to discriminate. Ignored when `labels` * or `classifierId` are provided. Default: 2 (NONE / ALL). */ routes?: 2 | 4; /** Labels for zero-shot classification. Overrides `routes`. */ labels?: readonly string[]; /** * Minimum classifier confidence (cosine similarity in `[0, 1]`) required * to trust a classifier prediction. When `outcome.score` is below this * threshold, the router fails open to `ALL` with reason * `"classifier_low_confidence"` rather than acting on a noisy decision. * * Rationale: Jina v3 zero-shot scores cluster around 0.25 when none of * the labels actually match the query. Trusting only confident scores * keeps the gate fail-safe. */ minConfidence?: number; } /** * Default applied by {@link decideRoute} when a caller omits * `minConfidence`. Matches the production default in the plugin schema. */ export declare const DEFAULT_MIN_CONFIDENCE = 0.35; export interface RouterRuntimeContext { query: string; trigger?: string; /** Whether the messageProvider is the local CLI test harness. */ isCli?: boolean; /** Optional AbortSignal propagated to the classifier HTTP call. */ signal?: AbortSignal; } /** * Decide the route for one user turn. * * Returns a {@link RouterDecision}. The plugin caller logs `reason` and * uses `route` to gate the recall call. */ export declare function decideRoute(cfg: RouterConfig, ctx: RouterRuntimeContext): Promise;