/** * Helpers for detecting and parsing the llama.cpp addon's * `ContextOverflow` status error (`LlmErrors.hpp::ContextOverflow = 14`). * * The addon's JS-facing throw goes through `js_throw_error(env, code, * msg)` (see `JsUtils.hpp::JSCATCH`) where `code` comes from * `qvac_errors::StatusError::codeString()` and formats as * `"[ :: ContextOverflow ]"`. The message carries the * C++-formatted detail (which may include the prompt/ctx sizes). * * These helpers let the plugin handler convert that addon error into a * typed `ContextOverflowError` and let unit tests assert the detection * + extraction logic without a real model load. */ export declare function isAddonContextOverflowError(err: unknown): boolean; /** * Best-effort extraction of `promptTokens` / `ctxSize` from the addon * error message. The C++ paths in `TextLlmContext.cpp` and * `MtmdLlmContext.cpp` format both numbers into the message; the * `LlamaModel::processPromptImpl` fallback path emits a bare * `": context overflow\n"` with neither number. Returning * `undefined` for either field is fine — `ContextOverflowError` holds * them as optional and the message factory degrades gracefully. */ export declare function parseContextOverflowMessage(message: string): { promptTokens?: number; ctxSize?: number; }; //# sourceMappingURL=context-overflow.d.ts.map