{
  "format": "xlibrary-plugin",
  "manifestVersion": 2,
  "apiVersion": 1,
  "id": "plugin-reference",
  "name": "XLibrary Plugin Reference",
  "version": "0.1.0",
  "minAppVersion": "2.1.0",
  "description": "A reference implementation of every public XLibrary plugin contribution.",
  "entry": "runtime/index.js",
  "permissions": [
    "library.games.read",
    "library.games.write",
    "sessions.events.read",
    "tracking.providers",
    "game.custom-fields",
    "game.actions",
    "plugin.storage",
    "plugin.cache",
    "plugin.settings",
    "plugin.auth",
    "network.http",
    "notifications.show",
    "jobs.run",
    "game-sources.providers",
    "browser.page.capture",
    "imports.sources",
    "exports.targets",
    "backup.contribute",
    "filters.facets",
    "ui.game-details.sidebar",
    "ui.game-details.header",
    "ui.dashboard.widget",
    "ui.library.toolbar",
    "ui.settings.section"
  ],
  "contributions": {
    "imports": [
      {
        "id": "reference-json",
        "title": "Reference JSON",
        "description": "Imports games from a simple JSON file.",
        "fileExtensions": [".json"],
        "supportsAutomaticDetection": true
      }
    ],
    "exports": [
      {
        "id": "reference-json",
        "title": "Reference JSON",
        "description": "Exports selected games as JSON.",
        "fileExtension": ".json",
        "mimeType": "application/json"
      }
    ],
    "filters": [
      {
        "id": "has-reference-tag",
        "kind": "boolean",
        "title": "Has reference tag",
        "description": "Filters games marked by the reference plugin."
      },
      {
        "id": "reference-status",
        "kind": "select",
        "title": "Reference status",
        "options": [
          {"label": "Planned", "value": "planned"},
          {"label": "Playing", "value": "playing"},
          {"label": "Completed", "value": "completed"}
        ]
      }
    ],
    "ui": [
      {"id": "sidebar", "slot": "ui.game-details.sidebar", "title": "Reference sidebar"},
      {"id": "header", "slot": "ui.game-details.header", "title": "Reference header"},
      {"id": "dashboard", "slot": "ui.dashboard.widget", "title": "Reference dashboard"},
      {"id": "toolbar", "slot": "ui.library.toolbar", "title": "Reference toolbar"},
      {"id": "settings", "slot": "ui.settings.section", "title": "Reference settings"}
    ],
    "gameFields": [
      {"id": "reference-score", "kind": "number", "label": "Reference score", "minimum": 0, "maximum": 100},
      {"id": "reference-note", "kind": "text", "label": "Reference note", "maximumLength": 280}
    ],
    "tracking": [
      {
        "id": "reference-tracking",
        "title": "Reference session tracker",
        "description": "Receives session start and end events.",
        "eventTypes": ["started", "ended"]
      }
    ],
    "gameActions": [
      {
        "id": "mark-reference",
        "title": "Mark as reference",
        "description": "Adds a tag and writes a score field.",
        "requiresConfirmation": true
      }
    ],
    "settings": {
      "dataVersion": 1,
      "title": "Reference settings",
      "description": "Settings used by the reference implementation.",
      "fields": [
        {
          "id": "endpoint",
          "kind": "text",
          "label": "Endpoint",
          "defaultValue": "https://example.com",
          "maximumLength": 200
        }
      ]
    },
    "storage": {"dataVersion": 1},
    "network": {"allowedHosts": ["example.com"]},
    "auth": [
      {
        "id": "reference-account",
        "title": "Reference account",
        "description": "Demonstrates the auth broker without exposing session data.",
        "loginUrl": "https://example.com/login",
        "completionUrl": "https://example.com/oauth/callback",
        "allowedHosts": ["example.com"]
      }
    ],
    "jobs": [
      {
        "id": "reference-job",
        "title": "Reference scheduled job",
        "triggers": ["startup", "session-started", "session-ended"],
        "minimumIntervalSeconds": 300
      }
    ],
    "gameSources": [
      {
        "id": "reference-catalog",
        "title": "Reference catalog",
        "description": "Demonstrates search, resolve, refresh and browser capture.",
        "hosts": ["catalog.example"],
        "operations": ["search", "resolve", "refresh", "browser-capture"]
      }
    ],
    "backup": {
      "dataVersion": 1,
      "title": "Reference plugin data"
    }
  }
}
