{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://knightcode.dev/schemas/theme.schema.json",
  "$comment": "This file is generated from TypeScript source. Do not edit it manually; run bun run generate:schemas.",
  "type": "object",
  "required": [
    "name",
    "colors"
  ],
  "properties": {
    "$schema": {
      "type": "string",
      "description": "JSON schema reference"
    },
    "name": {
      "type": "string",
      "pattern": "^[^/]+$",
      "description": "Theme name. Must not contain '/' because it is reserved for automatic light/dark theme settings."
    },
    "appearance": {
      "anyOf": [
        {
          "type": "string",
          "const": "dark"
        },
        {
          "type": "string",
          "const": "light"
        }
      ],
      "description": "Background the theme is designed for. Detected from the theme colors when omitted."
    },
    "vars": {
      "type": "object",
      "patternProperties": {
        "^.*$": {
          "$ref": "#/$defs/ColorValue"
        }
      },
      "description": "Reusable color variables"
    },
    "colors": {
      "type": "object",
      "required": [
        "accent",
        "border",
        "borderAccent",
        "borderMuted",
        "success",
        "error",
        "warning",
        "muted",
        "dim",
        "text",
        "thinkingText",
        "selectedBg",
        "userMessageBg",
        "userMessageText",
        "customMessageBg",
        "customMessageText",
        "customMessageLabel",
        "toolPendingBg",
        "toolSuccessBg",
        "toolErrorBg",
        "toolTitle",
        "toolOutput",
        "mdHeading",
        "mdLink",
        "mdLinkUrl",
        "mdCode",
        "mdCodeBlock",
        "mdCodeBlockBorder",
        "mdQuote",
        "mdQuoteBorder",
        "mdHr",
        "mdListBullet",
        "toolDiffAdded",
        "toolDiffRemoved",
        "toolDiffContext",
        "syntaxComment",
        "syntaxKeyword",
        "syntaxFunction",
        "syntaxVariable",
        "syntaxString",
        "syntaxNumber",
        "syntaxType",
        "syntaxOperator",
        "syntaxPunctuation",
        "bashMode"
      ],
      "properties": {
        "accent": {
          "$ref": "#/$defs/ColorValue",
          "description": "Primary accent color (logo, selected items, cursor)"
        },
        "border": {
          "$ref": "#/$defs/ColorValue",
          "description": "Normal borders"
        },
        "borderAccent": {
          "$ref": "#/$defs/ColorValue",
          "description": "Highlighted borders"
        },
        "borderMuted": {
          "$ref": "#/$defs/ColorValue",
          "description": "Subtle borders"
        },
        "success": {
          "$ref": "#/$defs/ColorValue",
          "description": "Success states"
        },
        "error": {
          "$ref": "#/$defs/ColorValue",
          "description": "Error states"
        },
        "warning": {
          "$ref": "#/$defs/ColorValue",
          "description": "Warning states"
        },
        "muted": {
          "$ref": "#/$defs/ColorValue",
          "description": "Secondary/dimmed text"
        },
        "dim": {
          "$ref": "#/$defs/ColorValue",
          "description": "Very dimmed text (more subtle than muted)"
        },
        "text": {
          "$ref": "#/$defs/ColorValue",
          "description": "Default text color (usually empty string)"
        },
        "thinkingText": {
          "$ref": "#/$defs/ColorValue",
          "description": "Thinking block text color"
        },
        "scrollbarTrack": {
          "$ref": "#/$defs/ColorValue",
          "description": "Fullscreen scrollbar track foreground (falls back to muted when omitted)"
        },
        "scrollbarThumb": {
          "$ref": "#/$defs/ColorValue",
          "description": "Fullscreen scrollbar thumb foreground (falls back to text when omitted)"
        },
        "selectedBg": {
          "$ref": "#/$defs/ColorValue",
          "description": "Selected item background"
        },
        "searchMatchBg": {
          "$ref": "#/$defs/ColorValue",
          "description": "Transcript search match background and current-match text (falls back to selectedBg when omitted)"
        },
        "searchMatchText": {
          "$ref": "#/$defs/ColorValue",
          "description": "Transcript search match text and current-match background (falls back to text when omitted)"
        },
        "userMessageBg": {
          "$ref": "#/$defs/ColorValue",
          "description": "User message background"
        },
        "userMessageText": {
          "$ref": "#/$defs/ColorValue",
          "description": "User message text color"
        },
        "customMessageBg": {
          "$ref": "#/$defs/ColorValue",
          "description": "Custom message background (hook-injected messages)"
        },
        "customMessageText": {
          "$ref": "#/$defs/ColorValue",
          "description": "Custom message text color"
        },
        "customMessageLabel": {
          "$ref": "#/$defs/ColorValue",
          "description": "Custom message type label color"
        },
        "toolPendingBg": {
          "$ref": "#/$defs/ColorValue",
          "description": "Tool execution box (pending state)"
        },
        "toolSuccessBg": {
          "$ref": "#/$defs/ColorValue",
          "description": "Tool execution box (success state)"
        },
        "toolErrorBg": {
          "$ref": "#/$defs/ColorValue",
          "description": "Tool execution box (error state)"
        },
        "toolTitle": {
          "$ref": "#/$defs/ColorValue",
          "description": "Tool execution box title color"
        },
        "toolOutput": {
          "$ref": "#/$defs/ColorValue",
          "description": "Tool execution box output text color"
        },
        "mdHeading": {
          "$ref": "#/$defs/ColorValue",
          "description": "Markdown heading text"
        },
        "mdLink": {
          "$ref": "#/$defs/ColorValue",
          "description": "Markdown link text"
        },
        "mdLinkUrl": {
          "$ref": "#/$defs/ColorValue",
          "description": "Markdown link URL"
        },
        "mdCode": {
          "$ref": "#/$defs/ColorValue",
          "description": "Markdown inline code"
        },
        "mdCodeBlock": {
          "$ref": "#/$defs/ColorValue",
          "description": "Markdown code block content"
        },
        "mdCodeBlockBorder": {
          "$ref": "#/$defs/ColorValue",
          "description": "Markdown code block fences"
        },
        "mdQuote": {
          "$ref": "#/$defs/ColorValue",
          "description": "Markdown blockquote text"
        },
        "mdQuoteBorder": {
          "$ref": "#/$defs/ColorValue",
          "description": "Markdown blockquote border"
        },
        "mdHr": {
          "$ref": "#/$defs/ColorValue",
          "description": "Markdown horizontal rule"
        },
        "mdListBullet": {
          "$ref": "#/$defs/ColorValue",
          "description": "Markdown list bullets/numbers"
        },
        "toolDiffAdded": {
          "$ref": "#/$defs/ColorValue",
          "description": "Added lines in tool diffs"
        },
        "toolDiffRemoved": {
          "$ref": "#/$defs/ColorValue",
          "description": "Removed lines in tool diffs"
        },
        "toolDiffContext": {
          "$ref": "#/$defs/ColorValue",
          "description": "Context lines in tool diffs"
        },
        "syntaxComment": {
          "$ref": "#/$defs/ColorValue",
          "description": "Syntax highlighting: comments"
        },
        "syntaxKeyword": {
          "$ref": "#/$defs/ColorValue",
          "description": "Syntax highlighting: keywords"
        },
        "syntaxFunction": {
          "$ref": "#/$defs/ColorValue",
          "description": "Syntax highlighting: function names"
        },
        "syntaxVariable": {
          "$ref": "#/$defs/ColorValue",
          "description": "Syntax highlighting: variable names"
        },
        "syntaxString": {
          "$ref": "#/$defs/ColorValue",
          "description": "Syntax highlighting: string literals"
        },
        "syntaxNumber": {
          "$ref": "#/$defs/ColorValue",
          "description": "Syntax highlighting: number literals"
        },
        "syntaxType": {
          "$ref": "#/$defs/ColorValue",
          "description": "Syntax highlighting: type names"
        },
        "syntaxOperator": {
          "$ref": "#/$defs/ColorValue",
          "description": "Syntax highlighting: operators"
        },
        "syntaxPunctuation": {
          "$ref": "#/$defs/ColorValue",
          "description": "Syntax highlighting: punctuation"
        },
        "thinkingOff": {
          "$ref": "#/$defs/ColorValue",
          "description": "Thinking level border: off (falls back to border when omitted)"
        },
        "thinkingMinimal": {
          "$ref": "#/$defs/ColorValue",
          "description": "Thinking level border: minimal (falls back to thinkingOff when omitted)"
        },
        "thinkingLow": {
          "$ref": "#/$defs/ColorValue",
          "description": "Thinking level border: low (falls back to thinkingMinimal when omitted)"
        },
        "thinkingMedium": {
          "$ref": "#/$defs/ColorValue",
          "description": "Thinking level border: medium (falls back to thinkingLow when omitted)"
        },
        "thinkingHigh": {
          "$ref": "#/$defs/ColorValue",
          "description": "Thinking level border: high (falls back to thinkingMedium when omitted)"
        },
        "thinkingXhigh": {
          "$ref": "#/$defs/ColorValue",
          "description": "Thinking level border: xhigh (falls back to thinkingHigh when omitted)"
        },
        "thinkingMax": {
          "$ref": "#/$defs/ColorValue",
          "description": "Thinking level border: max (falls back to thinkingXhigh when omitted)"
        },
        "bashMode": {
          "$ref": "#/$defs/ColorValue",
          "description": "Editor border color in bash mode"
        }
      },
      "description": "Theme color definitions (scrollbar, thinking level borders, and search highlight colors are optional and use compatible fallbacks)",
      "additionalProperties": false
    },
    "export": {
      "type": "object",
      "properties": {
        "pageBg": {
          "$ref": "#/$defs/ColorValue",
          "description": "Page background color"
        },
        "cardBg": {
          "$ref": "#/$defs/ColorValue",
          "description": "Card/container background color"
        },
        "infoBg": {
          "$ref": "#/$defs/ColorValue",
          "description": "Info sections background (system prompt, notices)"
        }
      },
      "description": "Optional colors for HTML export (defaults derived from userMessageBg if not specified)",
      "additionalProperties": false
    }
  },
  "title": "KnightCode Coding Agent Theme",
  "description": "Theme schema for KnightCode coding agent",
  "additionalProperties": false,
  "$defs": {
    "ColorValue": {
      "anyOf": [
        {
          "type": "string",
          "description": "Hex color (#RGB or #RRGGBB), OKLCH or OKHSL color, variable reference, or empty string for terminal default"
        },
        {
          "type": "integer",
          "minimum": 0,
          "maximum": 255,
          "description": "256-color palette index (0-255)"
        }
      ]
    }
  }
}
