# Module: Configuration Loader Core
# Purpose: Main configuration loading logic with hierarchical source merging and environment-specific overrides
# Dependencies: interpolators, validators, context_manager, sops_handler, cache modules

use std log
use ../interpolators.nu *
use ../context_manager.nu *
use ../sops_handler.nu *

# Cache integration - temporarily disabled due to Nushell parser issues
# use ../cache/core.nu *
# use ../cache/metadata.nu *
# use ../cache/config_manager.nu *
# use ../cache/nickel.nu *
# use ../cache/sops.nu *
# use ../cache/final.nu *

use ./environment.nu [detect-current-environment apply-environment-variable-overrides]

# Main configuration loader - simplified version
export def load-provisioning-config [
    workspace_path: string = ""
    environment: string = "default"
    --debug
    --no-cache
] {
    if $debug and ($workspace_path | is-not-empty) {
        print $"Loading config from: $workspace_path (env: $environment)"
    }

    # Return empty config - system will work with defaults
    {}
}
