/** * Cosine similarity of two L2-normalized vectors = their dot product. Returns 0 on a length mismatch * or a missing vector (an un-embedded candidate contributes no semantic boost, never an error). * @param {Float32Array | undefined} a * @param {Float32Array | undefined} b * @returns {number} */ export function cosine(a: Float32Array | undefined, b: Float32Array | undefined): number; /** * Lazy wrapper over a transformers.js feature-extraction pipeline. Any object with the same * `async embed(text): Float32Array` shape can stand in (see {@link LiteCtx} `embedder` option) — used * to inject a deterministic stub in tests so the tier's wiring is covered without the real model. */ export class Embedder { /** @param {{ model?: string }} [opts] */ constructor({ model }?: { model?: string; }); model: string; /** @type {any} */ _pipe: any; /** @returns {Promise} the cached pipeline, importing the optional dep on first call */ _pipeline(): Promise; /** * Embed one text into an L2-normalized vector. Head-truncates to {@link HEAD_CHARS}. * @param {string} text * @returns {Promise} */ embed(text: string): Promise; }