{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://agenticdecks.com/schemas/v1/deckrun-voice.json",
  "$comment": "© 2026 Agentic Decks. Publicly readable. Not open source. See https://agenticdecks.com/schemas for usage terms.",
  "title": "Deckrun narration voice",
  "description": "Voice resource for narration. Deckrun-level identifier tied to a narration tier (system or premium). Used by POST /voices (onboarding) and GET /voices, and referenced by POST /generate via voice_id. Internal TTS backends are not exposed; tier determines capability and plan gating.",
  "type": "object",
  "required": ["voice_id", "tier", "display_name", "status"],
  "properties": {
    "voice_id": {
      "type": "string",
      "description": "Stable Deckrun voice identifier (e.g. deckrun://voices/shivaram-founder). Used in POST /generate."
    },
    "tier": {
      "type": "string",
      "enum": ["system", "premium"],
      "description": "Narration tier for this voice. system = built-in voice (all plans); premium = high-fidelity expressive voice (paid plans)."
    },
    "provider_voice_id": {
      "type": "string",
      "description": "Opaque backend voice identifier for premium voices. Not used for system tier."
    },
    "display_name": {
      "type": "string",
      "description": "Human-readable name for this voice (e.g. \"Shivaram Founder Voice\")."
    },
    "status": {
      "type": "string",
      "enum": ["active", "inactive", "archived"],
      "description": "Lifecycle state for this voice. active: usable for generation; inactive: temporarily disabled but may be reactivated; archived: permanently retired and cannot be reactivated for new generations."
    },
    "owner_account_id": {
      "type": "string",
      "description": "Account or organization that owns this voice. Used for scoping and AuthZ."
    },
    "created_at": {
      "type": "string",
      "format": "date-time",
      "description": "When this voice was created (ISO 8601)."
    },
    "updated_at": {
      "type": "string",
      "format": "date-time",
      "description": "When this voice was last updated (ISO 8601)."
    },
    "source": {
      "type": "string",
      "enum": ["system", "user_upload", "enterprise_import"],
      "description": "How this voice was created: system = built-in voice; user_upload = created from user-provided samples; enterprise_import = imported from an enterprise/provider process."
    },
    "capabilities": {
      "type": "object",
      "description": "Declared capabilities for this voice. Helps UIs and validation avoid unsupported combinations.",
      "properties": {
        "supports_cloning": { "type": "boolean" },
        "supports_style_controls": { "type": "boolean" }
      },
      "required": ["supports_cloning", "supports_style_controls"],
      "additionalProperties": false
    },
    "schema_version": {
      "type": "string",
      "description": "Schema version used when this voice was created (e.g. \"v1\"). Useful for safe migrations and backward-compatible behavior."
    },
    "metadata": {
      "type": "object",
      "description": "Optional arbitrary metadata (e.g. tags, notes). Not used by the engine.",
      "additionalProperties": true
    }
  },
  "allOf": [
    {
      "if": {
        "properties": {
          "tier": { "enum": ["premium"] }
        },
        "required": ["tier"]
      },
      "then": {
        "required": ["provider_voice_id"]
      }
    }
  ],
  "additionalProperties": false
}
