# Local Provider Configuration Schema
# For testing and local development environments

let defaults = import "./local-defaults.ncl" in

{
  # Contract definitions

  LocalAuth = {
    interface | String,
  },

  LocalPaths = {
    base | String,
    cache | String,
    state | String,
    vms | String,
  },

  LocalAPI = {
    url | String,
    timeout | Number,
  },

  LocalProvider = {
    name | String,
    enabled | Bool,
    workspace | String,
    auth | LocalAuth,
    paths | LocalPaths,
    api | LocalAPI,
  },

  # Hybrid interface
  defaults = defaults,

  make_auth | not_exported = fun o =>
    defaults.auth & o,

  make_paths | not_exported = fun o =>
    defaults.paths & o,

  make_api | not_exported = fun o =>
    defaults.api & o,

  make_local | not_exported = fun o =>
    defaults.local & o,

  # Default instances
  DefaultAuth = defaults.auth,
  DefaultPaths = defaults.paths,
  DefaultAPI = defaults.api,
  DefaultLocalProvider = defaults.local,
}
