{
  "format": "ai-links",
  "formatVersion": "0.1-experimental",
  "experimental": true,
  "id": "https://www.jiaoyi123.cn/.well-known/ai-links.json",
  "name": "jiaoyi123 Open Web Search",
  "description": "Account-free public web search that presents one primary destination and a small set of alternative links.",
  "icon": "https://www.jiaoyi123.cn/icon-192.png",
  "outputKind": "ranked-public-web-links",
  "links": [
    {
      "rel": "self",
      "href": "https://www.jiaoyi123.cn/.well-known/ai-links.json",
      "type": "application/json"
    },
    {
      "rel": "describedby",
      "href": "https://www.jiaoyi123.cn/.well-known/site-identity.json",
      "type": "application/ld+json"
    },
    {
      "rel": "help",
      "href": "https://www.jiaoyi123.cn/about/",
      "type": "text/html"
    },
    {
      "rel": "search",
      "href": "https://www.jiaoyi123.cn/api/ai-search",
      "type": "application/json",
      "method": "POST"
    }
  ],
  "access": {
    "authenticationRequired": false,
    "credentialsRequired": false,
    "cors": {
      "allowOrigins": ["*"],
      "allowMethods": ["GET", "POST", "OPTIONS"],
      "allowHeaders": ["content-type"],
      "allowCredentials": false
    }
  },
  "operations": {
    "submitSearch": {
      "rel": "search",
      "method": "POST",
      "href": "https://www.jiaoyi123.cn/api/ai-search",
      "request": {
        "contentType": "application/json",
        "bodySchema": {
          "type": "object",
          "required": ["query"],
          "properties": {
            "query": {
              "type": "string"
            }
          },
          "additionalProperties": true
        },
        "queryConstraints": {
          "trimWhitespace": true,
          "nonEmptyAfterTrim": true,
          "maxUtf16CodeUnits": 500
        }
      },
      "responses": {
        "202": {
          "contentType": "application/json",
          "schemaRef": "#/schemas/job"
        },
        "400": { "schemaRef": "#/schemas/error" },
        "413": { "schemaRef": "#/schemas/error" },
        "415": { "schemaRef": "#/schemas/error" },
        "429": { "schemaRef": "#/schemas/error" },
        "503": { "schemaRef": "#/schemas/error" }
      }
    },
    "readSearchJob": {
      "rel": "item",
      "method": "GET",
      "hrefTemplate": "https://www.jiaoyi123.cn/api/ai-search/{id}",
      "templateSyntax": "RFC6570",
      "templateVariables": {
        "id": {
          "type": "string",
          "pattern": "^[A-Za-z0-9-]+$"
        }
      },
      "responses": {
        "200": {
          "contentType": "application/json",
          "schemaRef": "#/schemas/job"
        },
        "404": { "schemaRef": "#/schemas/error" }
      }
    }
  },
  "delivery": {
    "asynchronous": true,
    "pollOperation": "readSearchJob",
    "terminalStatuses": ["complete"],
    "progressiveResults": true,
    "resultOrderMayChangeUntilTerminal": true,
    "cacheControl": "no-store"
  },
  "retention": {
    "jobAvailabilitySeconds": 600,
    "startsAt": "createdAt",
    "storage": "volatile-process-memory",
    "survivesProcessRestart": false,
    "expiredReadStatus": 404
  },
  "linkSemantics": {
    "results[].url": {
      "rel": "item",
      "meaning": "Canonicalized public destination URL"
    },
    "results[].engines": {
      "role": "provenance",
      "meaning": "Search engines that surfaced this destination"
    }
  },
  "schemas": {
    "error": {
      "type": "object",
      "required": ["error"],
      "properties": {
        "error": { "type": "string" }
      }
    },
    "job": {
      "type": "object",
      "required": [
        "id",
        "query",
        "status",
        "createdAt",
        "updatedAt",
        "progress",
        "engines",
        "results"
      ],
      "properties": {
        "id": { "type": "string" },
        "query": { "type": "string" },
        "status": { "enum": ["queued", "searching", "complete"] },
        "createdAt": { "type": "string", "format": "date-time" },
        "updatedAt": { "type": "string", "format": "date-time" },
        "completedAt": { "type": "string", "format": "date-time" },
        "progress": {
          "type": "object",
          "required": ["done", "total"],
          "properties": {
            "done": { "type": "integer", "minimum": 0 },
            "total": { "type": "integer", "minimum": 0 }
          }
        },
        "engines": {
          "type": "array",
          "items": {
            "type": "object",
            "required": ["id", "name", "status", "resultCount"],
            "properties": {
              "id": { "type": "string" },
              "name": { "type": "string" },
              "status": { "enum": ["queued", "searching", "complete"] },
              "resultCount": { "type": "integer", "minimum": 0 },
              "durationMs": { "type": "integer", "minimum": 0 }
            }
          }
        },
        "results": {
          "type": "array",
          "maxItems": 24,
          "items": {
            "type": "object",
            "required": ["id", "title", "url", "domain", "snippet", "engines", "rank"],
            "properties": {
              "id": { "type": "string" },
              "title": { "type": "string", "maxLength": 240 },
              "url": { "type": "string", "pattern": "^https?://" },
              "domain": { "type": "string" },
              "snippet": { "type": "string", "maxLength": 600 },
              "engines": {
                "type": "array",
                "items": {
                  "type": "object",
                  "required": ["id", "name"],
                  "properties": {
                    "id": { "type": "string" },
                    "name": { "type": "string" }
                  }
                }
              },
              "rank": { "type": "integer", "minimum": 1 }
            }
          }
        }
      }
    }
  }
}
