openapi: 3.1.0
info:
  title: Bomber Company Agent Context API
  version: 0.1.0
  description: Public read-only context API for external agents.
servers:
  - url: https://boooooom.shop
paths:
  /api/v1/company/agent-manifest:
    get:
      operationId: getCompanyAgentManifest
      summary: Discover agent capabilities and public resources
      responses:
        "200":
          description: Capability manifest
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/AgentManifest"
  /api/v1/company/whitepaper:
    get:
      operationId: getCompanyWhitepaper
      summary: Read the contribution-points white paper
      parameters:
        - name: format
          in: query
          schema:
            type: string
            enum: [markdown, json]
            default: markdown
      responses:
        "200":
          description: UTF-8 Markdown or a JSON envelope
          content:
            text/markdown:
              schema:
                type: string
            application/json:
              schema:
                type: object
                required: [resource, content]
                properties:
                  resource:
                    $ref: "#/components/schemas/Resource"
                  content:
                    type: string
        "400":
          description: Unsupported format
  /api/v1/company/whitepaper/sections:
    get:
      operationId: getCompanyWhitepaperSections
      summary: List Markdown sections and source line ranges
      responses:
        "200":
          description: Section index
          content:
            application/json:
              schema:
                type: object
                required: [resource, sections]
                properties:
                  resource:
                    $ref: "#/components/schemas/Resource"
                  sections:
                    type: array
                    items:
                      $ref: "#/components/schemas/Section"
components:
  schemas:
    AgentManifest:
      type: object
      required: [schema, name, version, phase, capabilities, resources, cli]
      properties:
        schema:
          const: boooooom.company-agent/v1
        name:
          type: string
        version:
          type: string
        phase:
          type: string
        capabilities:
          type: object
          additionalProperties:
            type: object
        resources:
          type: array
          items:
            $ref: "#/components/schemas/Resource"
        cli:
          type: object
    Resource:
      type: object
      required: [id, kind, version, locale, filename, bytes, sha256, contentUrl, downloadUrl]
      properties:
        id:
          type: string
        kind:
          const: markdown
        version:
          type: string
        locale:
          type: string
        title:
          type: string
        filename:
          type: string
        bytes:
          type: integer
          minimum: 1
        sha256:
          type: string
          pattern: "^[a-f0-9]{64}$"
        contentUrl:
          type: string
        downloadUrl:
          type: string
        sectionsUrl:
          type: string
    Section:
      type: object
      required: [id, level, title, path, lineStart, lineEnd]
      properties:
        id:
          type: string
        level:
          type: integer
          minimum: 1
          maximum: 6
        title:
          type: string
        path:
          type: array
          items:
            type: string
        lineStart:
          type: integer
          minimum: 1
        lineEnd:
          type: integer
          minimum: 1
