{
  "$schema": "https://json-schema.org/draft-07/schema#",
  "$id": "https://local/knowledge/anytype-integration/schemas/inbox-entry.schema.json",
  "title": "AnyType Inbox Entry",
  "type": "object",
  "required": ["captured_at", "capture_source", "content", "data_classification"],
  "additionalProperties": false,
  "properties": {
    "captured_at": { "type": "string", "format": "date-time" },
    "capture_source": {
      "type": "string",
      "enum": ["chat", "clipboard", "email", "voice", "manual"],
      "description": "Named capture_source (not source) because the 'source' key is reserved by AnyType's built-in URL property on Bookmark types."
    },
    "content": {
      "type": "string",
      "minLength": 1,
      "description": "Raw captured text. Anytype stores rich text; this is its serialized form."
    },
    "data_classification": {
      "type": "string",
      "enum": ["private_sensitive", "internal", "low_sensitive"],
      "description": "Required at capture time per SPB-01."
    },
    "processed": { "type": "boolean", "default": false },
    "result_ref": {
      "type": "object",
      "description": "Reference to the upgraded object after classification.",
      "properties": {
        "object_type": { "type": "string", "enum": ["Person", "Event", "Idea", "Project", "Source"] },
        "id": { "type": "string" }
      }
    }
  }
}
