# Workspace Configuration Schema
# Defines the structure and validation rules for workspace metadata and settings

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

{
  # Contract definitions for workspace components

  WorkspaceMetadata = {
    owner | String,
    created | String,
    environment | String,
  },

  WorkspaceConfig = {
    name | String,
    path | String,
    description | String,
    metadata | WorkspaceMetadata,
  },

  # Hybrid interface: Defaults, makers, and instances
  defaults = defaults,

  make_metadata | not_exported = fun o =>
    defaults.metadata & o,

  make_workspace | not_exported = fun o =>
    defaults.workspace & o,

  # Default instances
  DefaultMetadata = defaults.metadata,
  DefaultWorkspaceConfig = defaults.workspace,
}
