{
    "openapi": "3.0.3",
    "info": {
        "title": "JhoWeb — Agent Discovery API",
        "description": "Endpoints públicos para LLMs e agentes descobrirem ferramentas online do JhoWeb. Não há API de cálculo server-side: a maioria das ferramentas roda no navegador. Use /ai/tools.json e /ai/{slug}.md para contexto estruturado.",
        "version": "1.0.0",
        "contact": {
            "name": "JhoWeb",
            "url": "https://jhoweb.com.br/"
        }
    },
    "servers": [
        {
            "url": "https://jhoweb.com.br"
        }
    ],
    "externalDocs": {
        "description": "Guia para assistentes de IA",
        "url": "https://jhoweb.com.br/para-ias.php"
    },
    "paths": {
        "/ai/tools.json": {
            "get": {
                "operationId": "getAgentsCatalog",
                "summary": "Catálogo completo de ferramentas (JSON)",
                "description": "Lista ferramentas com URL canônica, fórmulas, exemplos e links Markdown para IA.",
                "tags": [
                    "discovery"
                ],
                "responses": {
                    "200": {
                        "description": "Catálogo de agentes",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "site": {
                                            "type": "string",
                                            "format": "uri"
                                        },
                                        "name": {
                                            "type": "string"
                                        },
                                        "language": {
                                            "type": "string"
                                        },
                                        "description": {
                                            "type": "string"
                                        },
                                        "updated": {
                                            "type": "string",
                                            "format": "date"
                                        },
                                        "tools": {
                                            "type": "array",
                                            "items": {
                                                "type": "object"
                                            }
                                        },
                                        "categories": {
                                            "type": "array",
                                            "items": {
                                                "type": "object"
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
        },
        "/ai/{slug}.md": {
            "get": {
                "operationId": "getToolMarkdown",
                "summary": "Markdown citável de uma ferramenta",
                "tags": [
                    "discovery"
                ],
                "parameters": [
                    {
                        "name": "slug",
                        "in": "path",
                        "required": true,
                        "description": "Slug da ferramenta (ex.: imc, porcentagem, validador-cpf).",
                        "schema": {
                            "type": "string",
                            "pattern": "^[a-z0-9-]+$",
                            "example": "imc"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Markdown da ferramenta",
                        "content": {
                            "text/markdown": {
                                "schema": {
                                    "type": "string"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Ferramenta não encontrada"
                    }
                }
            }
        },
        "/llms.txt": {
            "get": {
                "operationId": "getLlmsTxt",
                "summary": "Índice llms.txt",
                "tags": [
                    "discovery"
                ],
                "responses": {
                    "200": {
                        "description": "Texto plano llms.txt",
                        "content": {
                            "text/plain": {
                                "schema": {
                                    "type": "string"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/llms-full.txt": {
            "get": {
                "operationId": "getLlmsFullTxt",
                "summary": "llms-full com fórmulas e exemplos",
                "tags": [
                    "discovery"
                ],
                "responses": {
                    "200": {
                        "description": "Texto plano llms-full.txt",
                        "content": {
                            "text/plain": {
                                "schema": {
                                    "type": "string"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/.well-known/health": {
            "get": {
                "operationId": "getHealth",
                "summary": "Status / health do serviço de descoberta",
                "tags": [
                    "status"
                ],
                "responses": {
                    "200": {
                        "description": "Serviço saudável",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "status": {
                                            "type": "string",
                                            "example": "ok"
                                        },
                                        "service": {
                                            "type": "string"
                                        },
                                        "site": {
                                            "type": "string",
                                            "format": "uri"
                                        },
                                        "time": {
                                            "type": "string",
                                            "format": "date-time"
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    },
    "tags": [
        {
            "name": "discovery",
            "description": "Descoberta de ferramentas para agentes"
        },
        {
            "name": "status",
            "description": "Saúde do serviço"
        }
    ]
}
