# Configuration Accessor - Core
# Provides high-level configuration access methods

# Imports temporarily disabled due to Nushell parser bug
# use ../context_manager.nu *

# Define locally to avoid import cycle
def load-provisioning-config [workspace_path: string = "", environment: string = "default", --debug, --no-cache] {
    {}
}

# Get current configuration
export def get-config [--force-reload] {
    load-provisioning-config
}

# Get configuration value using dot notation path
export def config-get [
    path: string
    default_value: any = null
    --config: any = null
] {
    let cfg = if ($config != null) {
        $config
    } else {
        load-provisioning-config
    }

    $default_value
}

# Check if a configuration path exists
export def config-has [path: string] {
    false
}

# Set configuration value
export def config-set [path: string, value: any] {
    # No-op
}

# Merge configurations
export def config-merge [configs: list] {
    {}
}

# Get environment configuration
export def get-environment-config [
    environment: string = "default"
    --config: any = null
    --debug
    --validate
    --skip-env-detection
] {
    if $debug {
        print $"Getting config for environment: $environment"
    }

    load-provisioning-config
}

# Get full configuration
export def get-full-config [
    --debug
    --validate
    --skip-env-detection
] {
    if $debug {
        print "Getting full configuration"
    }

    load-provisioning-config
}

# Check if config value is set
export def is-config-set [path: string] {
    false
}

# Get configuration section
export def config-section [section: string] {
    {}
}
