/** * Strategy registry — name → factory for each of the 4 groups. * * Mirrors `src/cache/strategyRegistry.ts` exactly: maps a string name * to a factory function that takes vendor-specific config and returns * a typed strategy instance. Vendor adapter subpaths self-register on * import via side-effect. * * Two ways consumers wire a strategy: * * 1. By NAME (registry lookup) — the recommended path for vendor * adapters: * ```ts * import 'agentfootprint/observability-datadog'; // self-registers 'datadog' * agent.enable.observability({ vendor: 'datadog', config: { apiKey } }); * ``` * * 2. By INSTANCE (explicit pass) — for custom in-house strategies * or test mocks: * ```ts * agent.enable.observability({ strategy: myCustomStrategy }); * ``` * * The two paths are mutually exclusive in `EnableOptions` — the type * union enforces that consumers pick one. * * Lookup is exact-match by name (case-insensitive fallback). Unknown * names return `undefined`; the consumer's `enable.X` then no-ops * (per "do nothing if not configured" rule). */ import type { ObservabilityStrategy, CostStrategy, LiveStatusStrategy, LensStrategy } from './types.js'; /** Vendor adapter subpaths register a factory keyed by their vendor * name. Config shape is vendor-specific — type-erased at the registry * boundary; consumer's responsibility to pass the right shape. */ export type ObservabilityFactory = (config?: unknown) => ObservabilityStrategy; export type CostFactory = (config?: unknown) => CostStrategy; export type LiveStatusFactory = (config?: unknown) => LiveStatusStrategy; export type LensFactory = (config?: unknown) => LensStrategy; /** * Register a vendor observability strategy by name. Called from the * vendor's subpath at module load (side-effect import): * * ```ts * // agentfootprint/observability-datadog/index.ts * import { registerObservabilityStrategy } from 'agentfootprint/strategies'; * registerObservabilityStrategy('datadog', (config) => datadogObservability(config)); * ``` * * Replacing an existing registration is allowed — most-recent wins. * Useful for test mocks. */ export declare function registerObservabilityStrategy(name: string, factory: ObservabilityFactory): void; /** Look up an observability factory by vendor name. Case-insensitive * fallback. Returns `undefined` when the name is unknown — caller * decides to noop or throw. */ export declare function getObservabilityStrategy(name: string): ObservabilityFactory | undefined; /** Diagnostic — list all registered vendor names. */ export declare function listObservabilityStrategies(): readonly string[]; export declare function registerCostStrategy(name: string, factory: CostFactory): void; export declare function getCostStrategy(name: string): CostFactory | undefined; export declare function listCostStrategies(): readonly string[]; export declare function registerLiveStatusStrategy(name: string, factory: LiveStatusFactory): void; export declare function getLiveStatusStrategy(name: string): LiveStatusFactory | undefined; export declare function listLiveStatusStrategies(): readonly string[]; export declare function registerLensStrategy(name: string, factory: LensFactory): void; export declare function getLensStrategy(name: string): LensFactory | undefined; export declare function listLensStrategies(): readonly string[]; /** Reset every registry to empty. Tests only — not in the public * barrel. */ export declare function _resetRegistriesForTests(): void; //# sourceMappingURL=registry.d.ts.map