/** * @fileoverview Central orchestrator for fitness recipe execution * * FitnessRecipeService resolves checks, manages session lifecycle, * coordinates parallel/sequential execution, and builds results. */ import { type AdHocRecipeArgs } from './service-adhoc.js'; import { type FitnessRecipe, type FitnessRecipeResult } from './types.js'; import type { FitnessRecipeServiceCallbacks, FitnessRecipeServiceConfig, FitnessRecipeSession } from './service-types.js'; /** * Central orchestrator for fitness check execution. */ export declare class FitnessRecipeService { private readonly config; private readonly checkRegistry; private readonly recipeRegistry; /** * Per-run file cache, resolved ONCE at `executeRecipeInScope` entry (NOT in * the constructor — the constructor may run before a scope exists). It is the * SINGLE instance read by prewarm, `execOpts.fileCache`, and the `finally` * `clear()`; resolving it elsewhere (a divergent function-local) would * reintroduce the cache-instance-mismatch bug this phase fixes. */ private fileCache; private activeSession; private abortController?; constructor(config?: FitnessRecipeServiceConfig); private get session(); /** * Execute a fitness recipe by name or recipe object. * * Resolves checks, prewarms the file cache, runs checks in parallel or sequential mode, * then builds and returns a {@link FitnessRecipeResult}. Only one session can be active * at a time — call {@link abort} to cancel a running session. * * @param recipeOrName - A recipe name (looked up in the recipe registry) or a FitnessRecipe object. * @returns The result of the recipe execution including per-check results and summary. * @throws {SystemError} If a session is already in progress. * @throws {NotFoundError} If the recipe name is not found in the registry. */ start(recipeOrName: FitnessRecipe | string): Promise; private executeRecipe; private installAdHocFitnessSubscope; private executeRecipeInScope; /** * Convert CLI arguments to an ad-hoc FitnessRecipe. */ static createAdHocRecipe(args: AdHocRecipeArgs): FitnessRecipe; /** Get the currently active session, or null if no recipe is running. */ getActiveSession(): FitnessRecipeSession | null; /** Abort the currently running recipe execution. No-op if no session is active. */ abort(): void; /** List all available recipes from the recipe registry. */ listRecipes(): readonly FitnessRecipe[]; /** * Look up a recipe by name or ID. * @param nameOrId - The recipe name or full recipe ID (e.g. "default" or "RCP_default"). * @returns The recipe if found, undefined otherwise. */ getRecipe(nameOrId: string): FitnessRecipe | undefined; protected generateSessionId(): string; protected get callbacks(): FitnessRecipeServiceCallbacks; } //# sourceMappingURL=service.d.ts.map