openapi: 3.1.0
info:
  title: morpheus
  version: 1.0.0
  description: |
    Agent discoverability auditor. Probes DNS-AID, DIDs, AID, AgentFinder,
    AI-Catalog, model cards, /.well-known/agent.json and reports a
    dnsviz-style visibility score with pass/warn/fail/error findings.
servers:
  - url: https://morpheus.darknetian.com
paths:
  /ask:
    post:
      summary: One-shot conversation turn
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required: [message]
              properties:
                message: { type: string, maxLength: 4000 }
                session_id: { type: string, description: "Reuse a session for multi-turn." }
      responses:
        "200":
          description: Agent reply
          content:
            application/json:
              schema:
                type: object
                properties:
                  reply: { type: string }
                  tool_calls: { type: array }
                  stop_reason: { type: string }
                  session_id: { type: string }
        "429": { description: Rate limited }
        "502": { description: Upstream error }
  /chat:
    post:
      summary: Streaming chat (SSE) for the browser widget
      description: |
        Returns text/event-stream. Events:
          - probe_started   { name, args }
          - probe_result    { name, finding[] }
          - tool_use        { name, input }
          - tool_result     { name, summary }
          - text_delta      { delta }
          - score           { score, sub_scores }
          - dcv_required    { domain, record_name, record_value }
          - done            { session_id, stop_reason }
          - error           { message }
      responses:
        "200":
          description: Server-Sent Events stream
          content:
            text/event-stream: {}
