/** * Gateway Configuration System * * Type-safe, extensible configuration with module augmentation. * Packages extend FileConfig via `declare module "@agentick/gateway"`. * * ConfigStore is the read path — always use .get(key), never destructured * snapshots. Hot-reload-aware from day one (onChange handlers). * * Schema registry lets each package register a Zod fragment at module load * time. Gateway merges and validates once at startup. */ import type { ZodLikeSchema } from "./types.js"; /** Core gateway config — augmented by packages via `declare module` */ export interface FileConfig { gateway?: { port?: number; host?: string; transport?: "websocket" | "http" | "both"; logging?: { /** Log level (default: "info"). Set to "trace" for full event stream visibility. */ level?: "trace" | "debug" | "info" | "warn" | "error" | "fatal" | "silent"; /** Log output file path. When set, logs are written here instead of stdout. */ file?: string; }; }; connectors?: ConnectorConfigs; providers?: ProviderConfigs; } /** Connector config — each connector plugin augments this */ export interface ConnectorConfigs { } /** Provider config — each adapter augments this */ export interface ProviderConfigs { } export interface ConfigStore { /** Get a top-level config section */ get(key: K): FileConfig[K]; /** Get the fully resolved config snapshot */ resolved(): Readonly; /** Get the config with secret values replaced by "***" */ redacted(): Readonly; /** Subscribe to changes (hot-reload ready, noop initially) */ onChange(handler: (config: Readonly) => void): () => void; } export declare function createConfigStore(resolved: FileConfig, secretPaths?: Set): ConfigStore; /** Register a config schema fragment (called at module load time) */ export declare function registerConfigSchema(key: string, schema: ZodLikeSchema): void; /** * Build the merged schema from all registered fragments. * Returns a ZodLikeSchema whose parse() validates the full config. * * The merged schema is an object where each registered key maps to * its fragment schema (all optional at the top level). */ export declare function buildConfigSchema(): ZodLikeSchema; /** Reset schema registry (for testing only) */ export declare function resetConfigSchemaRegistry(): void; export declare function bindConfig(store: ConfigStore): void; export declare function getConfig(): ConfigStore; export declare function getConfigOrNull(): ConfigStore | null; /** Reset global binding (for testing only) */ export declare function resetConfigBinding(): void; //# sourceMappingURL=config.d.ts.map