/** * Scanner type registry: map type string to Scanner factory. */ import type { Scanner } from "../scanners/protocol/scanner.js"; import { RetentionPolicy, type ScannerOutputs } from "../scanners/scanner-definition.js"; export type ScannerFactory = () => Scanner; /** * Recipe-authored scanner options that only apply when the runtime is building * a dynamic `external_scanner`. * * Built-in scanners already encode their outputs and retention behavior in code, * so the registry only needs YAML-level config overrides for them. External * scanners are different: their outputs and retention are declared directly in * the runtime recipe, so the registry must receive that metadata and pass it * into the synthesized scanner definition. */ export interface RuntimeScannerFactoryOptions { outputs?: ScannerOutputs; retention?: RetentionPolicy | `${RetentionPolicy}`; retentionMaxRuns?: number; } /** Registers one scanner factory under a runtime type alias. */ declare function register(type: string, factory: ScannerFactory): void; /** Returns the scanner factory currently associated with one runtime type alias. */ declare function get(type: string): ScannerFactory | undefined; /** * Returns a stable, alphabetically sorted list of every registered scanner * type alias. Used for error messages so operators who mistype a scanner * `type:` in YAML see the full set of supported values without having to * consult documentation. */ declare function listTypes(): string[]; /** * Builds the canonical "unknown scanner type" error message including the full * list of registered types. Centralized so every call site (scanner registry * factory creation, runtime startup validation) renders the same operator * guidance. */ declare function formatUnknownScannerTypeError(type: string): string; /** * Create a scanner factory for the given type, with YAML name as the runtime id. * The returned factory builds a fresh scanner instance for each registration and * shallow-merges any YAML-level config overrides onto the scanner's default config. * * Why the external-scanner branch exists: * built-in scanners start from a fixed code definition and then accept YAML * overrides, but `external_scanner` is authored from recipe data itself. The * registry therefore has to synthesize a scanner definition from YAML for that * type instead of instantiating a built-in scanner and patching it afterward. */ declare function createScanner(type: string, yamlName: string, configOverrides?: unknown, dependsOn?: Array<{ scanner: string; required?: boolean; max_age_seconds?: number; on_missing?: "fail" | "skip" | "degrade"; on_stale?: "fail" | "skip" | "degrade"; }>, options?: RuntimeScannerFactoryOptions): ScannerFactory; export declare const ScannerRegistry: { register: typeof register; get: typeof get; listTypes: typeof listTypes; formatUnknownScannerTypeError: typeof formatUnknownScannerTypeError; createScanner: typeof createScanner; }; export {}; //# sourceMappingURL=scanner-registry.d.ts.map