{
  "openapi": "3.1.0",
  "info": {
    "title": "dirango public service API",
    "version": "1.0.0",
    "description": "Anonymous, stateless access to public service information and a pure project-brief draft preparer. Preparing a brief never submits or stores it."
  },
  "servers": [
    {
      "url": "https://dirango.com"
    }
  ],
  "paths": {
    "/api/agent-services": {
      "get": {
        "operationId": "getAgentServiceCatalog",
        "summary": "Read the public service catalog",
        "responses": {
          "200": {
            "description": "Public service catalog",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "version": {
                      "const": 1
                    },
                    "services": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "additionalProperties": false,
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "title": {
                            "type": "string"
                          },
                          "description": {
                            "type": "string"
                          },
                          "url": {
                            "type": "string",
                            "format": "uri"
                          },
                          "engagement": {
                            "type": "string"
                          },
                          "platforms": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            }
                          },
                          "topics": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            }
                          },
                          "caseStudies": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "additionalProperties": false,
                              "properties": {
                                "title": {
                                  "type": "string"
                                },
                                "url": {
                                  "type": "string",
                                  "format": "uri"
                                },
                                "context": {
                                  "type": "string"
                                }
                              },
                              "required": [
                                "title",
                                "url",
                                "context"
                              ]
                            }
                          }
                        },
                        "required": [
                          "id",
                          "title",
                          "description",
                          "url",
                          "engagement",
                          "platforms",
                          "topics",
                          "caseStudies"
                        ]
                      }
                    }
                  },
                  "required": [
                    "version",
                    "services"
                  ]
                }
              }
            }
          },
          "503": {
            "description": "The generated catalog is unavailable"
          }
        }
      },
      "post": {
        "operationId": "lookupAgentServices",
        "summary": "Find services by topic and platform",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "query": {
                    "type": "string",
                    "maxLength": 500
                  },
                  "platform": {
                    "type": "string",
                    "enum": [
                      "wordpress",
                      "shopify",
                      "other",
                      "unsure"
                    ]
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Matching public services",
            "content": {
              "application/json": {
                "schema": {
                  "oneOf": [
                    {
                      "type": "object",
                      "additionalProperties": false,
                      "properties": {
                        "success": {
                          "const": true
                        },
                        "data": {
                          "type": "object",
                          "properties": {
                            "services": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "additionalProperties": false,
                                "properties": {
                                  "id": {
                                    "type": "string"
                                  },
                                  "title": {
                                    "type": "string"
                                  },
                                  "description": {
                                    "type": "string"
                                  },
                                  "url": {
                                    "type": "string",
                                    "format": "uri"
                                  },
                                  "engagement": {
                                    "type": "string"
                                  },
                                  "platforms": {
                                    "type": "array",
                                    "items": {
                                      "type": "string"
                                    }
                                  },
                                  "topics": {
                                    "type": "array",
                                    "items": {
                                      "type": "string"
                                    }
                                  },
                                  "caseStudies": {
                                    "type": "array",
                                    "items": {
                                      "type": "object",
                                      "additionalProperties": false,
                                      "properties": {
                                        "title": {
                                          "type": "string"
                                        },
                                        "url": {
                                          "type": "string",
                                          "format": "uri"
                                        },
                                        "context": {
                                          "type": "string"
                                        }
                                      },
                                      "required": [
                                        "title",
                                        "url",
                                        "context"
                                      ]
                                    }
                                  }
                                },
                                "required": [
                                  "id",
                                  "title",
                                  "description",
                                  "url",
                                  "engagement",
                                  "platforms",
                                  "topics",
                                  "caseStudies"
                                ]
                              }
                            },
                            "query": {
                              "type": "string"
                            },
                            "platform": {
                              "type": [
                                "string",
                                "null"
                              ]
                            }
                          },
                          "required": [
                            "services",
                            "query",
                            "platform"
                          ]
                        }
                      },
                      "required": [
                        "success",
                        "data"
                      ]
                    },
                    {
                      "type": "object",
                      "additionalProperties": false,
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "error": {
                          "type": "object",
                          "additionalProperties": false,
                          "properties": {
                            "code": {
                              "type": "string"
                            },
                            "message": {
                              "type": "string"
                            }
                          },
                          "required": [
                            "code",
                            "message"
                          ]
                        }
                      },
                      "required": [
                        "success",
                        "error"
                      ]
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "error": {
                      "type": "object",
                      "additionalProperties": false,
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "code",
                        "message"
                      ]
                    }
                  },
                  "required": [
                    "success",
                    "error"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Origin is not allowed"
          },
          "405": {
            "description": "Method is not supported"
          },
          "413": {
            "description": "Request body exceeds 16 KiB"
          },
          "415": {
            "description": "Content-Type must be application/json"
          },
          "503": {
            "description": "The generated catalog is unavailable"
          }
        }
      }
    },
    "/api/agent-brief": {
      "post": {
        "operationId": "prepareProjectBrief",
        "summary": "Prepare a brief for human review",
        "description": "Returns a normalized draft and required unanswered form fields. Does not save or submit the draft.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "goals": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 1200
                  },
                  "engagement": {
                    "type": "string",
                    "enum": [
                      "new-site",
                      "redesign",
                      "development",
                      "accessibility",
                      "governance",
                      "cookie-consent",
                      "ongoing-support",
                      "not-sure"
                    ]
                  },
                  "platform": {
                    "type": "string",
                    "enum": [
                      "wordpress",
                      "shopify",
                      "other",
                      "unsure"
                    ]
                  },
                  "website": {
                    "type": "string",
                    "maxLength": 2048,
                    "format": "uri",
                    "pattern": "^https?://"
                  },
                  "budget": {
                    "type": "string",
                    "enum": [
                      "under-10k",
                      "10-25k",
                      "25-50k",
                      "50-100k",
                      "100k-plus",
                      "unsure",
                      "under-1k",
                      "1-2-5k",
                      "2-5k",
                      "5-10k",
                      "10k-plus"
                    ]
                  },
                  "timeline": {
                    "type": "string",
                    "enum": [
                      "asap",
                      "1-3-months",
                      "3-6-months",
                      "flexible"
                    ]
                  }
                },
                "required": [
                  "goals"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Draft and missing required fields",
            "content": {
              "application/json": {
                "schema": {
                  "oneOf": [
                    {
                      "type": "object",
                      "additionalProperties": false,
                      "properties": {
                        "success": {
                          "const": true
                        },
                        "data": {
                          "type": "object",
                          "properties": {
                            "draft": {
                              "type": "object"
                            },
                            "requiresHumanReview": {
                              "const": true
                            },
                            "reviewUrl": {
                              "type": "string",
                              "format": "uri"
                            },
                            "missingFields": {
                              "type": "array",
                              "items": {
                                "type": "string"
                              }
                            }
                          },
                          "required": [
                            "draft",
                            "requiresHumanReview",
                            "reviewUrl",
                            "missingFields"
                          ]
                        }
                      },
                      "required": [
                        "success",
                        "data"
                      ]
                    },
                    {
                      "type": "object",
                      "additionalProperties": false,
                      "properties": {
                        "success": {
                          "const": false
                        },
                        "error": {
                          "type": "object",
                          "additionalProperties": false,
                          "properties": {
                            "code": {
                              "type": "string"
                            },
                            "message": {
                              "type": "string"
                            }
                          },
                          "required": [
                            "code",
                            "message"
                          ]
                        }
                      },
                      "required": [
                        "success",
                        "error"
                      ]
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "error": {
                      "type": "object",
                      "additionalProperties": false,
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "code",
                        "message"
                      ]
                    }
                  },
                  "required": [
                    "success",
                    "error"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Origin is not allowed"
          },
          "405": {
            "description": "Method is not supported"
          },
          "413": {
            "description": "Request body exceeds 16 KiB"
          },
          "415": {
            "description": "Content-Type must be application/json"
          }
        }
      }
    },
    "/mcp": {
      "get": {
        "summary": "GET event stream unsupported",
        "responses": {
          "405": {
            "description": "Server-sent events are not supported for GET"
          }
        }
      },
      "post": {
        "summary": "Stateless MCP Streamable HTTP endpoint",
        "description": "Supports JSON-RPC initialize, notifications/initialized, ping, tools/list, and tools/call. Requests are single messages; batches and persistent sessions are not supported.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "description": "A single JSON-RPC 2.0 request or notification."
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "JSON-RPC response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "202": {
            "description": "Notification accepted with an empty body"
          },
          "400": {
            "description": "Malformed JSON-RPC request"
          },
          "403": {
            "description": "Origin is not allowed"
          },
          "405": {
            "description": "Method is not supported"
          },
          "406": {
            "description": "Accept must include application/json and text/event-stream"
          },
          "413": {
            "description": "Request body exceeds 16 KiB"
          },
          "415": {
            "description": "Content-Type must be application/json"
          }
        }
      }
    }
  }
}
