{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://annon.dev/.well-known/annon.schema.json",
  "title": "Annon deployment manifest",
  "description": "The fields of https://annon.dev/.well-known/annon.json. schema_version changes when a field is removed or changes meaning.",
  "type": "object",
  "required": [
    "$schema",
    "schema_version",
    "name",
    "network",
    "contract",
    "contract_status",
    "relayer",
    "demo_host",
    "demo_file",
    "spec_status",
    "spec",
    "vectors",
    "packages",
    "install",
    "mcp_client_config",
    "payments",
    "docs",
    "llms",
    "llms_full",
    "links",
    "source"
  ],
  "properties": {
    "$schema": {
      "const": "https://annon.dev/.well-known/annon.schema.json"
    },
    "schema_version": {
      "const": 2
    },
    "name": {
      "const": "Annon"
    },
    "network": {
      "const": "mainnet"
    },
    "contract": {
      "type": "string",
      "minLength": 1
    },
    "contract_status": {
      "type": "object",
      "required": [
        "code_hash",
        "deployed_at",
        "source_commit",
        "upgradeable",
        "full_access_keys",
        "reproducible",
        "audit",
        "manifest",
        "check"
      ],
      "properties": {
        "code_hash": {
          "type": "string",
          "minLength": 1
        },
        "deployed_at": {
          "type": "string",
          "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
        },
        "source_commit": {
          "type": "string",
          "pattern": "^[0-9a-f]{40}$"
        },
        "upgradeable": {
          "type": "boolean"
        },
        "full_access_keys": {
          "type": "array",
          "items": {
            "type": "string",
            "minLength": 1
          }
        },
        "reproducible": {
          "type": "boolean"
        },
        "audit": {
          "type": [
            "object",
            "string",
            "null"
          ]
        },
        "manifest": {
          "type": "string",
          "pattern": "^https://"
        },
        "check": {
          "type": "string",
          "pattern": "^https://annon\\.dev/"
        }
      },
      "additionalProperties": false
    },
    "relayer": {
      "type": "string",
      "pattern": "^https://"
    },
    "demo_host": {
      "type": "string",
      "pattern": "^https://"
    },
    "demo_file": {
      "type": "string",
      "pattern": "^https://"
    },
    "spec_status": {
      "enum": [
        "draft",
        "stable"
      ]
    },
    "spec": {
      "type": "object",
      "additionalProperties": {
        "type": "object",
        "required": [
          "title",
          "version",
          "url",
          "markdown"
        ],
        "properties": {
          "title": {
            "type": "string",
            "minLength": 1
          },
          "version": {
            "type": "string",
            "minLength": 1
          },
          "url": {
            "type": "string",
            "pattern": "^https://annon\\.dev/"
          },
          "markdown": {
            "type": "string",
            "pattern": "^https://annon\\.dev/"
          }
        },
        "additionalProperties": false
      }
    },
    "vectors": {
      "type": "object",
      "additionalProperties": {
        "type": "object",
        "required": [
          "url",
          "sha256"
        ],
        "properties": {
          "url": {
            "type": "string",
            "pattern": "^https://annon\\.dev/"
          },
          "sha256": {
            "type": "string",
            "pattern": "^[0-9a-f]{64}$"
          }
        },
        "additionalProperties": false
      }
    },
    "packages": {
      "type": "array",
      "minItems": 1,
      "items": {
        "type": "object",
        "required": [
          "name",
          "version"
        ],
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1
          },
          "version": {
            "type": "string",
            "pattern": "^\\d+\\.\\d+\\.\\d+(?:-[\\w.]+)?$"
          }
        },
        "additionalProperties": false
      }
    },
    "install": {
      "type": "object",
      "required": [
        "node",
        "cli",
        "mcp",
        "claude_code"
      ],
      "properties": {
        "node": {
          "type": "string",
          "minLength": 1
        },
        "cli": {
          "type": "string",
          "minLength": 1
        },
        "mcp": {
          "type": "string",
          "minLength": 1
        },
        "claude_code": {
          "type": "string",
          "minLength": 1
        }
      },
      "additionalProperties": false
    },
    "mcp_client_config": {
      "type": "object",
      "required": [
        "mcpServers"
      ],
      "properties": {
        "mcpServers": {
          "type": "object",
          "required": [
            "annon"
          ],
          "properties": {
            "annon": {
              "type": "object",
              "required": [
                "command",
                "args",
                "env"
              ],
              "properties": {
                "command": {
                  "type": "string",
                  "minLength": 1
                },
                "args": {
                  "type": "array",
                  "items": {
                    "type": "string",
                    "minLength": 1
                  }
                },
                "env": {
                  "type": "object",
                  "required": [
                    "ANNON_CONFIG",
                    "ANNON_BACKUP_SECRET_FILE"
                  ],
                  "properties": {
                    "ANNON_CONFIG": {
                      "type": "string",
                      "minLength": 1
                    },
                    "ANNON_BACKUP_SECRET_FILE": {
                      "type": "string",
                      "minLength": 1
                    }
                  },
                  "additionalProperties": false
                }
              },
              "additionalProperties": false
            }
          },
          "additionalProperties": false
        }
      },
      "additionalProperties": false
    },
    "payments": {
      "type": "object",
      "required": [
        "x402_version",
        "annon_extension_version",
        "profile",
        "routes"
      ],
      "properties": {
        "x402_version": {
          "const": 2
        },
        "annon_extension_version": {
          "const": 3
        },
        "profile": {
          "type": "string",
          "pattern": "^https://annon\\.dev/"
        },
        "routes": {
          "type": "array",
          "minItems": 1,
          "items": {
            "type": "object",
            "required": [
              "route",
              "scheme",
              "network"
            ],
            "properties": {
              "route": {
                "enum": [
                  "near",
                  "base",
                  "1click"
                ]
              },
              "scheme": {
                "enum": [
                  "annon-near-usdc",
                  "annon-exact"
                ]
              },
              "network": {
                "type": "string",
                "minLength": 1
              },
              "asset": {
                "type": "string",
                "minLength": 1
              },
              "currency": {
                "const": "USDC"
              },
              "via": {
                "type": "string",
                "minLength": 1
              },
              "api": {
                "type": "string",
                "pattern": "^https://"
              }
            },
            "additionalProperties": false
          }
        }
      },
      "additionalProperties": false
    },
    "docs": {
      "type": "string",
      "pattern": "^https://annon\\.dev/"
    },
    "llms": {
      "type": "string",
      "pattern": "^https://annon\\.dev/"
    },
    "llms_full": {
      "type": "string",
      "pattern": "^https://annon\\.dev/"
    },
    "links": {
      "type": "object",
      "required": [
        "agents",
        "agents_markdown",
        "agents_guide",
        "skill",
        "skill_markdown",
        "shop_manifest",
        "catalog",
        "status",
        "security_txt",
        "sitemap"
      ],
      "properties": {
        "agents": {
          "type": "string",
          "pattern": "^https://annon\\.dev/"
        },
        "agents_markdown": {
          "type": "string",
          "pattern": "^https://annon\\.dev/"
        },
        "agents_guide": {
          "type": "string",
          "pattern": "^https://annon\\.dev/"
        },
        "skill": {
          "type": "string",
          "pattern": "^https://annon\\.dev/"
        },
        "skill_markdown": {
          "type": "string",
          "pattern": "^https://annon\\.dev/"
        },
        "shop_manifest": {
          "type": "string",
          "pattern": "^https://annon\\.dev/"
        },
        "catalog": {
          "type": "string",
          "pattern": "^https://"
        },
        "status": {
          "type": "string",
          "pattern": "^https://annon\\.dev/"
        },
        "security_txt": {
          "type": "string",
          "pattern": "^https://annon\\.dev/"
        },
        "sitemap": {
          "type": "string",
          "pattern": "^https://annon\\.dev/"
        }
      },
      "additionalProperties": false
    },
    "source": {
      "type": "object",
      "required": [
        "repo",
        "commit"
      ],
      "properties": {
        "repo": {
          "type": "string",
          "pattern": "^https://"
        },
        "commit": {
          "type": "string",
          "pattern": "^[0-9a-f]{40}$"
        }
      },
      "additionalProperties": false
    }
  },
  "additionalProperties": false
}
