{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "$id": "gno://schemas/collection-list@1.0",
  "title": "GNO Collection List",
  "description": "List of configured collections",
  "type": "array",
  "items": {
    "type": "object",
    "required": ["name", "pattern", "include", "exclude"],
    "properties": {
      "name": {
        "type": "string",
        "description": "Collection identifier (lowercase, alphanumeric with hyphens/underscores)",
        "pattern": "^[a-z0-9][a-z0-9_-]{0,63}$"
      },
      "path": {
        "type": "string",
        "description": "Absolute path to collection root directory. Same-host callers only: omitted for a remote REST caller."
      },
      "pattern": {
        "type": "string",
        "description": "Glob pattern for file matching",
        "default": "**/*"
      },
      "include": {
        "type": "array",
        "description": "Extension allowlist (empty = all)",
        "items": { "type": "string" }
      },
      "exclude": {
        "type": "array",
        "description": "Path patterns to skip",
        "items": { "type": "string" }
      },
      "updateCmd": {
        "type": "string",
        "description": "Optional shell command to run before indexing"
      },
      "updateCmdTimeoutMs": {
        "type": "integer",
        "minimum": 1,
        "description": "Optional limit for updateCmd in milliseconds; gno stops the command (and anything it started) after this long. Absent means the 10 minute default."
      },
      "languageHint": {
        "type": "string",
        "description": "BCP-47 language hint for the collection"
      },
      "workspaceRoot": {
        "description": "Configured link workspace: an absolute path joins the collection to that workspace root; false keeps links inside the collection. Absent means auto-detect. Same-host callers only: omitted for a remote REST caller.",
        "oneOf": [{ "type": "string" }, { "const": false }]
      },
      "effectiveWorkspaceRoot": {
        "type": "string",
        "description": "CLI list only: effective link workspace root (nearest .obsidian folder, or the configured root). Absent when links stay inside the collection."
      },
      "workspaceSource": {
        "type": "string",
        "enum": ["none", "detected", "configured", "disabled", "unavailable"],
        "description": "CLI list only: how the link workspace was set"
      }
    }
  }
}
