import { DynamicPlugin, type ProviderType } from '../../common'; import type { ConfigPluginOptions, ConfigPluginOptionsInput } from './config.types'; /** * ConfigPlugin - Environment variable management for FrontMCP. * * Provides typed access to configuration with convict-style nested path support. * Loads from .env files, YAML config files, and validates with Zod schemas. * * @example * ```typescript * // Basic usage (flat env vars) * @FrontMcp({ * plugins: [ * ConfigPlugin.init({ * envPath: '.env', * localEnvPath: '.env.local', * }), * ], * }) * class MyServer {} * * // With typed schema (convict-style) * import { z } from '@frontmcp/lazy-zod'; * * const configSchema = z.object({ * database: z.object({ * url: z.string(), * port: z.number().default(5432), * }), * debug: z.boolean().default(false), * }); * * @FrontMcp({ * plugins: [ * ConfigPlugin.init({ * schema: configSchema, * basePath: __dirname, * }), * ], * }) * class ProductionServer {} * * // In a tool: * class MyTool extends ToolContext { * async execute(input) { * // Typed access with dot notation * const dbUrl = this.config.getOrThrow('database.url'); * const port = this.config.get('database.port', 5432); * const debug = this.config.get('debug'); * } * } * ``` */ export default class ConfigPlugin> extends DynamicPlugin, ConfigPluginOptionsInput> { static defaultOptions: ConfigPluginOptions; options: ConfigPluginOptions; constructor(options?: ConfigPluginOptionsInput); /** * Dynamic providers based on plugin options. */ static dynamicProviders: (options: ConfigPluginOptionsInput) => ProviderType[]; } //# sourceMappingURL=config.plugin.d.ts.map