import { z } from '@botpress/sdk';
import { type Credentials, type ProjectCredentialsContext } from '../auth';
export interface StoredConfig {
    [key: string]: unknown;
}
export interface ConfigFieldDescriptor {
    key: string;
    type: 'string' | 'number' | 'boolean' | 'unknown';
    required: boolean;
    description?: string;
    defaultValue?: unknown;
    currentValue?: unknown;
}
export type SetResult = {
    success: false;
    error: string;
} | {
    success: true;
    data: unknown;
};
export interface ConfigManagerOptions {
    project?: ProjectCredentialsContext;
    credentials?: Credentials;
    apiUrl?: string;
    workspaceId?: string;
}
export declare class ConfigManager {
    private botId;
    private options;
    private client;
    constructor(botId: string, options?: ConfigManagerOptions);
    private getClient;
    /**
     * Load stored configuration from bot.configuration.data
     */
    load(): Promise<StoredConfig>;
    /**
     * Save configuration to bot.configuration
     */
    save(config: StoredConfig, schema?: z.ZodObject<any>): Promise<void>;
    /**
     * Get a configuration value
     */
    get(key: string): Promise<unknown>;
    /**
     * Set a configuration value
     */
    set(key: string, value: unknown, schema?: z.ZodObject<any>): Promise<void>;
    /**
     * Get all configuration values
     */
    getAll(): Promise<Record<string, unknown>>;
    /**
     * Validate configuration against a schema
     * Returns { valid: boolean, errors: string[], missing: string[] }
     */
    validate(schema: z.ZodObject<any>): Promise<{
        valid: boolean;
        errors: string[];
        missing: string[];
    }>;
    /**
     * Get missing required configuration keys
     */
    getMissingKeys(schema: z.ZodObject<any>): Promise<string[]>;
    /**
     * Check if configuration is valid
     */
    isValid(schema: z.ZodObject<any>): Promise<boolean>;
    /**
     * Describe the configuration schema as a serializable list of field descriptors.
     * Merges in current stored values so the UI can render a form without Zod access.
     */
    describeSchema(schema: z.ZodObject<any>): Promise<ConfigFieldDescriptor[]>;
    /**
     * Validate and set a single configuration key.
     * Handles coercion from string values (for CLI/UI text inputs).
     */
    setWithValidation(key: string, value: unknown, schema: z.ZodObject<any>): Promise<SetResult>;
}
//# sourceMappingURL=manager.d.ts.map