{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "title": "Chat connection draft (no active provider adapter)",
  "description": "Settings are stored server-side at ../AI_Portfolio_private/chat-config.json. Saving/importing never sends a provider request. API key is kept in that private file but omitted from GET/export; it is not part of this export schema.",
  "type": "object",
  "additionalProperties": false,
  "required": ["schemaVersion", "mode", "provider", "endpointUrl", "model", "tasks", "instructions", "requestTimeoutMs", "maxOutputTokens", "maxInputChars", "contactTarget"],
  "properties": {
    "schemaVersion": {"const": 1, "description": "Draft configuration version."},
    "mode": {"const": "draft", "description": "Only draft is implemented. Changing this field cannot activate inference."},
    "provider": {"enum": ["unselected", "openai", "runninghub", "other"], "default": "unselected", "description": "Future provider; selecting it does not implement an adapter or confirm availability."},
    "endpointUrl": {"type": "string", "maxLength": 500, "description": "Empty while undecided, otherwise an HTTPS endpoint without credentials/query/fragment. This version stores but never calls this URL. Provider/endpoint changes discard the previous API key unless a new key is supplied."},
    "model": {"type": "string", "maxLength": 120, "description": "Exact future model or application ID; never selected automatically."},
    "tasks": {"type": "array", "uniqueItems": true, "items": {"enum": ["image_analysis", "prompt_writing", "contact_admin"]}, "description": "Requested purposes. AI image analysis and prompt writing remain unavailable until an adapter is implemented. Contact links to the existing contact section, without automatically sending a message."},
    "instructions": {"type": "string", "maxLength": 6000, "description": "Future assistant instructions; stored as text, not executed."},
    "requestTimeoutMs": {"type": "integer", "minimum": 5000, "maximum": 120000, "default": 60000, "description": "Future single-request timeout; unused while draft.", "x-unit": "ms"},
    "maxOutputTokens": {"type": "integer", "minimum": 128, "maximum": 8192, "default": 1024, "description": "Future output token budget; actual parameter mapping must be validated against the selected provider."},
    "maxInputChars": {"type": "integer", "minimum": 100, "maximum": 30000, "default": 12000, "description": "Future text-input character limit; not a provider model limit."},
    "contactTarget": {"const": "#contact", "description": "Existing public contact section. No inbox, mail sending or external messaging service is configured."}
  }
}
