/** * Recommendation context assembler — reads meds/supplements from FactStore * and conditions/allergies/goals from the medical profile reader. * * NO network / NO LLM. All fs uses node:fs/promises (principles). * * FactStore lifecycle: injected store (tests) — caller owns; else open and close in finally. * Profile: wrapped in try/catch — degraded but functional when SOPS is unavailable or file absent. * * Most similar: src/medical/analysis/review-pass.ts (open-store / try / finally-close / inject-store). * supplement predicate is "dose" (not "takes-supplement") — see supplements.ts:106-121. */ import type { BoberConfig } from "../../config/schema.js"; import { FactStore } from "../../state/facts.js"; import type { FactRecord } from "../../state/facts.js"; import type { ProfileCipher } from "../profile.js"; export interface RecommendationContext { meds: FactRecord[]; supplements: Array<{ name: string; dose: string; }>; conditions: string[]; allergies: string[]; goal?: string; } export interface ContextDeps { /** Injected FactStore (tests pass :memory:); caller owns lifecycle. */ facts?: FactStore; /** Injected ProfileCipher for tests (avoids real SOPS binary). */ profileCipher?: ProfileCipher; } /** * Assemble the recommendation context from FactStore and the medical profile. * * Meds: scope="medical", subject="patient", predicate="takes-medication". * Supplements: scope="medical", predicate="dose" (subject = supplement name). * Profile: conditions/allergies/goals from profile.yaml; defaults to [] on any error. */ export declare function assembleRecommendationContext(projectRoot: string, _config: BoberConfig, opts: { goal?: string; }, deps?: ContextDeps): Promise; /** * Serialize a RecommendationContext to a plain string for runJudgeLoop. * runJudgeLoop.context must be a STRING — this bridges the object to that contract. */ export declare function contextToString(ctx: RecommendationContext): string; //# sourceMappingURL=context.d.ts.map