# Workspace Configuration Defaults (SST - Single Source of Truth)
#
# These are the default values for all workspace configurations.
# Workspaces override these defaults in their provisioning.ncl file.
#
# Pattern:
# - SST Defaults: nickel/workspace_config/defaults.ncl (this file)
# - SST Schema: nickel/workspace_config/contracts.ncl (schema definitions)
# - Workspace Config: config/provisioning.ncl (workspace-specific overrides)

let contracts = import "contracts.ncl" in

{
  default_workspace_config | contracts.WorkspaceConfig = {
    workspace = {
      name = "default-workspace",
      version = "1.0.0",
      created = "",
      current_infra = "",
      current_environment = "",
    },

    paths = {
      base = ".",
      infra = "infra",
      cache = ".cache",
      runtime = ".runtime",
      providers = ".providers",
      taskservs = ".taskservs",
      clusters = ".clusters",
      orchestrator = ".orchestrator",
      control_center = ".control-center",
      kms = ".kms",
      generate = "generate",
      run_clusters = "clusters",
      run_taskservs = "taskservs",
      extensions = ".provisioning-extensions",
      resources = "resources",
      templates = "templates",
      tools = "tools",
    },

    provisioning = {
      path = ".",
    },

    core = {
      version = "1.0.0",
      name = "provisioning",
    },

    debug = {
      enabled = false,
      metadata = false,
      check_mode = false,
      validation = false,
      remote = false,
      log_level = "info",
      no_terminal = false,
    },

    output = {
      file_viewer = "bat",
      format = "yaml",
    },

    http = {
      use_curl = false,
      timeout = 30,
    },

    providers = {
      active = ["upcloud"],
      default = "upcloud",
    },

    platform = {
      orchestrator_enabled = false,
      control_center_enabled = false,
      mcp_enabled = false,
    },

    secrets = {
      provider = "sops",
      sops_enabled = true,
      kms_enabled = false,
    },

    kms = {
      mode = "local",
      config_file = "config/kms.toml",
    },

    sops = {
      use_sops = true,
      config_path = ".sops.yaml",
      key_search_paths = [
        ".kms/keys/age.txt",
        "~/.config/sops/age/keys.txt",
      ],
    },

    ai = {
      enabled = false,
      provider = "openai",
      config_path = "config/ai.yaml",
    },

    taskservs = {
      run_path = ".runtime/taskservs",
    },

    clusters = {
      run_path = ".runtime/clusters",
    },

    generation = {
      dir_path = "generated",
      defs_file = "defs.toml",
    },

    cache = {
      enabled = true,
      path = ".cache/versions",
      infra_cache = "infra/default/cache/versions",
      grace_period = 86400,
      check_updates = false,
      max_cache_size = "10MB",
    },

    infra = {
      current = "default",
    },

    tools = {
      use_kcl = true,
      use_kcl_plugin = true,
      use_tera_plugin = true,
    },

    kcl = {
      core_module = "kcl",
      core_version = "0.0.1",
      core_package_name = "provisioning_core",
      use_module_loader = true,
      module_loader_path = "core/cli/module-loader",
      modules_dir = ".kcl-modules",
    },

    ssh = {
      user = "",
      options = [
        "StrictHostKeyChecking=accept-new",
        "UserKnownHostsFile=/dev/null",
      ],
      timeout = 30,
      debug = false,
    },
  },
}
