# Import Helper Functions
# Provides clean, environment-based imports to avoid relative paths

# Provider middleware imports
export def prov-middleware []: nothing -> string {
    $env.PROVISIONING_PROV_LIB | path join "middleware.nu"
}

export def prov-env-middleware []: nothing -> string {
    $env.PROVISIONING_PROV_LIB | path join "env_middleware.nu"
}

# Provider-specific imports
export def aws-env []: nothing -> string {
    $env.PROVISIONING_PROVIDERS_PATH | path join "aws" "nulib" "aws" "env.nu"
}

export def aws-servers []: nothing -> string {
    $env.PROVISIONING_PROVIDERS_PATH | path join "aws" "nulib" "aws" "servers.nu"
}

export def upcloud-env []: nothing -> string {
    $env.PROVISIONING_PROVIDERS_PATH | path join "upcloud" "nulib" "upcloud" "env.nu"
}

export def upcloud-servers []: nothing -> string {
    $env.PROVISIONING_PROVIDERS_PATH | path join "upcloud" "nulib" "upcloud" "servers.nu"
}

export def local-env []: nothing -> string {
    $env.PROVISIONING_PROVIDERS_PATH | path join "local" "nulib" "local" "env.nu"
}

export def local-servers []: nothing -> string {
    $env.PROVISIONING_PROVIDERS_PATH | path join "local" "nulib" "local" "servers.nu"
}

# Core module imports
export def core-servers []: nothing -> string {
    $env.PROVISIONING_CORE_NULIB | path join "servers"
}

export def core-taskservs []: nothing -> string {
    $env.PROVISIONING_CORE_NULIB | path join "taskservs"
}

export def core-clusters []: nothing -> string {
    $env.PROVISIONING_CORE_NULIB | path join "clusters"
}

# Lib provisioning imports (for internal cross-references)
export def lib-utils []: nothing -> string {
    $env.PROVISIONING_CORE_NULIB | path join "lib_provisioning" "utils"
}

export def lib-secrets []: nothing -> string {
    $env.PROVISIONING_CORE_NULIB | path join "lib_provisioning" "secrets"
}

export def lib-sops []: nothing -> string {
    $env.PROVISIONING_CORE_NULIB | path join "lib_provisioning" "sops"
}

export def lib-ai []: nothing -> string {
    $env.PROVISIONING_CORE_NULIB | path join "lib_provisioning" "ai"
}

# Helper for dynamic imports with specific files
export def import-path [base: string, file: string]: nothing -> string {
    $base | path join $file
}