/** * Config Helpers * * Helper functions for working with stack.yml config where * environments are stored as top-level keys. */ import type { FactiiiConfig, EnvironmentConfig, Stage } from '../types/index.js'; /** * Reserved top-level config keys that are NOT environments * Everything else at the top level is treated as an environment */ export declare const RESERVED_CONFIG_KEYS: readonly ["name", "config_version", "github_repo", "ssl_email", "pipeline", "prisma_schema", "prisma_version", "container_exclusions", "trusted_plugins", "ansible", "env_match_exceptions", "dev_only", "openclaw", "auth", "aws", "claude_skills"]; /** * Stage type — re-exported from types/plugin for convenience. * Canonical definition lives in src/types/plugin.ts. */ export type { Stage }; /** * Extract environment configs from config object * Environments = any top-level key NOT in reserved list * * @param config - The stack.yml config object * @returns Record of environment name to environment config */ export declare function extractEnvironments(config: FactiiiConfig): Record; /** * Check if config has any deployment environments defined * Returns false for addon-only repos (e.g., only openclaw: true) */ export declare function hasEnvironments(config: FactiiiConfig): boolean; /** * Map environment name to stage * * Rules: * - 'dev' → 'dev' * - starts with 'staging' or 'stage-' → 'staging' * - starts with 'prod' or equals 'production' → 'prod' * * @param envName - Environment name (e.g., 'staging2', 'prod') * @returns Stage name ('dev' | 'staging' | 'prod') * @throws Error if environment name doesn't match any pattern */ export declare function getStageFromEnvironment(envName: string): Stage; /** * Get all environments that match a specific stage * * @param config - The stack.yml config object * @param stage - Stage to filter by ('staging' | 'prod') * @returns Record of environment name to environment config for matching stage */ export declare function getEnvironmentsForStage(config: FactiiiConfig, stage: Stage): Record; /** * Get used server plugins from config * Looks at all environments and returns unique server plugin names * * @param config - The stack.yml config object * @returns Set of server plugin names used across all environments */ export declare function getUsedServerPlugins(config: FactiiiConfig): Set; /** * Get used plugins from config * Looks at all environment plugin configs and returns unique plugin names * * @param config - The stack.yml config object * @returns Set of plugin names used across all environments */ export declare function getUsedPlugins(config: FactiiiConfig): Set; /** * Validate environment name * Checks that environment name doesn't conflict with reserved keys * and follows naming conventions * * @param name - Environment name to validate * @returns Error message if invalid, null if valid */ /** * Local config interface (stack.local.yml) * Per-developer settings that are gitignored */ export interface LocalConfig { dev_os?: 'mac' | 'windows' | 'ubuntu'; dev_only?: boolean; openclaw?: boolean | { model?: string; }; claude_skills?: boolean; } /** * Load local config from stack.local.yml (or factiii.local.yml) * Returns empty object if file doesn't exist * * @param rootDir - Root directory of the project * @returns Parsed local config or empty object */ export declare function loadLocalConfig(rootDir: string): LocalConfig; /** * Load merged config from stack.yml + stackAuto.yml * stack.yml values take priority over stackAuto.yml * * @param rootDir - Root directory of the project * @returns Merged config or empty object if no config exists */ export declare function loadConfig(rootDir: string): FactiiiConfig; export declare function validateEnvironmentName(name: string): string | null; /** * Check if the project is in dev-only mode. * Returns true unless the merged config (stack.yml + stack.local) explicitly sets dev_only: false. * A fresh clone with no stack.local will always be dev-only. */ export declare function isDevOnly(config: FactiiiConfig): boolean; /** * Get the default vault path for a repo, based on config.name. * Produces per-repo vault files: vault-greasemoto.yml, vault-factiii.yml, etc. * Falls back to vault.yml if name is missing or starts with EXAMPLE. */ export declare function getDefaultVaultPath(config: FactiiiConfig): string; //# sourceMappingURL=config-helpers.d.ts.map