import type { FoodResponse, MacroField, RawFoodRow, SearchResponse, SearchResult } from "./types.js"; /** Build the full-detail public response for nutrition_lookup / nutrition_barcode. */ export declare function toFoodResponse(row: RawFoodRow): FoodResponse; /** Build the lean list-item public response for nutrition_search / nutrition_cache_list. */ export declare function toSearchResponse(row: SearchResult): SearchResponse; export interface OverrideMacroInput { calories?: number; protein?: number; fat?: number; carbs?: number; fiber?: number; sugar?: number; sodium?: number; } export type ResolveOverrideInputResult = { ok: true; converted: OverrideMacroInput; suppliedMacros: MacroField[]; } | { ok: false; error: string; }; /** * Validates and converts nutrition_override's per-serving/per-100g input into canonical per-100g * values. Extracted as a pure function (rather than living inline in the mcp.ts tool handler) so * the R10 rejection rule and the conversion math have a direct unit test, independent of the MCP * SDK's request/response plumbing. * * R10: basis "per_serving" with any macro field supplied REQUIRES serving_weight_g in the same * call — the stored weight is never used, since it may be exactly the value that's wrong. */ export declare function resolveOverrideInput(basis: "per_serving" | "per_100g", servingWeightG: number | undefined, fields: OverrideMacroInput): ResolveOverrideInputResult;