/** * @fileoverview Service-layer type definitions for fitness recipe execution * * Defines the configuration, session state, and callback types * used by FitnessRecipeService and its execution engines. */ import type { FitnessRecipeRegistry } from './registry.js'; import type { FitnessRecipe, FitnessRecipeResult, RecipeCheckResult, IgnoresByType } from './types.js'; import type { DirectiveEntry } from '../framework/directive-inventory.js'; import type { FileCache } from '../framework/file-cache.js'; import type { CheckMemoryProfile } from '../framework/memory-profiler.js'; import type { CheckRegistry } from '../framework/registry.js'; /** Summary of a single check execution for callback reporting */ export interface CheckSummary { readonly checkId: string; readonly checkSlug: string; readonly passed: boolean; readonly errors: number; readonly warnings: number; readonly durationMs: number; readonly filesScanned: number; readonly ignoredCount: number; readonly memoryProfile: CheckMemoryProfile; readonly timedOut?: boolean; readonly errorMessage?: string; } /** Callbacks invoked during recipe execution for progress and errors */ export interface FitnessRecipeServiceCallbacks { onCheckStart?: (checkSlug: string, index: number, total: number) => void; onCheckComplete?: (checkSlug: string, summary: CheckSummary, index: number, total: number) => void; onError?: (checkSlug: string, error: Error) => void; onMemoryWarning?: (checkId: string, profile: CheckMemoryProfile) => void; onComplete?: (result: FitnessRecipeResult) => void; /** Called before execution with all registered checks for catalog sync. */ onCatalogSync?: (entries: { id: string; slug: string; tags: readonly string[]; description: string; }[]) => void; } /** Configuration for the fitness recipe service */ export interface FitnessRecipeServiceConfig { cwd?: string; prewarmCache?: boolean; prewarmPatterns?: string[]; callbacks?: FitnessRecipeServiceCallbacks; /** Per-check pre-resolved paths keyed by stable check id (bare slug remains compatible). */ checkTargetFiles?: ReadonlyMap; /** Optional check registry (defaults to the current scope's check registry). */ checkRegistry?: CheckRegistry; /** Optional recipe registry (defaults to the current scope's recipe registry). */ recipeRegistry?: FitnessRecipeRegistry; /** Check slugs disabled via opensip.config.yml — these checks are skipped unless force-included by a recipe. */ disabledChecks?: readonly string[]; /** * Run-wide file exclusion patterns from `opensip-cli.config.yml`'s * top-level `globalExcludes`. Threaded into each check's RunOptions * so the matchFiles() fallback honors them — without this, scope-empty * checks scan every prewarmed file. Should be the same array passed * to `loadTargetsConfig`. */ globalExcludes?: readonly string[]; /** Optional file cache instance (defaults to a fresh per-service one for SaaS isolation). */ fileCache?: FileCache; } /** Mutable session state tracking progress during a recipe execution */ export interface FitnessRecipeSession { readonly sessionId: string; readonly recipe: FitnessRecipe; readonly startedAt: Date; status: 'running' | 'completed' | 'failed'; totalChecks: number; completedChecks: number; passedChecks: number; failedChecks: number; totalErrors: number; totalWarnings: number; totalIgnored: number; ignoresByTag: Map; checkResults: RecipeCheckResult[]; ignoreCounts?: IgnoresByType | undefined; directives: DirectiveEntry[]; } //# sourceMappingURL=service-types.d.ts.map