{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/archstone-dev/json-schema/archstone-dev-capabilities-schema.json",
  "title": "Capabilities",
  "x-generated": "2026-11-01",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/archstone-dev-openapi.yaml#/components/schemas/Capabilities",
  "type": "object",
  "required": [
    "version",
    "build",
    "features",
    "billing",
    "notifications",
    "auth",
    "retention",
    "limits",
    "hosted"
  ],
  "additionalProperties": false,
  "properties": {
    "version": {
      "type": "string",
      "description": "The console/API compatibility handshake version (BR-37) — never a build identifier."
    },
    "build": {
      "type": "string",
      "description": "The tag or commit this image was built from."
    },
    "features": {
      "type": "object",
      "required": [
        "multi_tenant",
        "billing",
        "offline_import",
        "hosted_runtime",
        "endpoint_listing",
        "registry_publishing"
      ],
      "additionalProperties": false,
      "properties": {
        "multi_tenant": {
          "type": "boolean"
        },
        "billing": {
          "type": "boolean"
        },
        "offline_import": {
          "type": "boolean"
        },
        "hosted_runtime": {
          "type": "boolean"
        },
        "endpoint_listing": {
          "type": "boolean",
          "description": "True only when both multi_tenant and hosted_runtime are true."
        },
        "registry_publishing": {
          "type": "boolean",
          "description": "True only when endpoint_listing is true and a registry signing key is configured and readable at boot."
        }
      }
    },
    "billing": {
      "type": "object",
      "required": [
        "methods",
        "freePeriod"
      ],
      "additionalProperties": false,
      "description": "Which billing providers this deployment can actually charge through. Distinct from features.billing, which only says whether billing is on at all.",
      "properties": {
        "methods": {
          "type": "array",
          "items": {
            "type": "string",
            "enum": [
              "card",
              "crypto"
            ]
          }
        },
        "freePeriod": {
          "description": "Billing is visible and self-serve-choosable before any payment rail is live, gated by this runtime setting rather than compiled in. null when BILLING_PAYMENTS_OPEN_AT is unset — unchanged behavior for a deployment that never sets it.",
          "oneOf": [
            {
              "type": "null"
            },
            {
              "type": "object",
              "required": [
                "opensAt",
                "graceEndsAt"
              ],
              "additionalProperties": false,
              "properties": {
                "opensAt": {
                  "type": "string",
                  "description": "ISO datetime checkout/downgrade/portal open at."
                },
                "graceEndsAt": {
                  "type": "string",
                  "description": "ISO datetime; opensAt + BILLING_GRACE_DAYS."
                }
              }
            }
          ]
        }
      }
    },
    "notifications": {
      "type": "object",
      "required": [
        "webhook",
        "smtp"
      ],
      "additionalProperties": false,
      "properties": {
        "webhook": {
          "type": "boolean"
        },
        "smtp": {
          "type": "boolean"
        }
      }
    },
    "auth": {
      "type": "object",
      "required": [
        "adapter",
        "kind",
        "productionReady"
      ],
      "additionalProperties": false,
      "properties": {
        "adapter": {
          "type": "string"
        },
        "kind": {
          "type": "string",
          "enum": [
            "credential",
            "redirect"
          ]
        },
        "productionReady": {
          "type": "boolean"
        },
        "notice": {
          "type": [
            "string",
            "null"
          ]
        }
      }
    },
    "retention": {
      "type": "object",
      "required": [
        "defaultDays",
        "enforcementImplemented"
      ],
      "additionalProperties": false,
      "properties": {
        "defaultDays": {
          "type": "integer"
        },
        "enforcementImplemented": {
          "type": "boolean"
        }
      }
    },
    "limits": {
      "type": "object",
      "required": [
        "exportMaxRows"
      ],
      "additionalProperties": false,
      "properties": {
        "exportMaxRows": {
          "type": "integer"
        }
      }
    },
    "hosted": {
      "oneOf": [
        {
          "type": "null"
        },
        {
          "type": "object",
          "required": [
            "runtimeUrl"
          ],
          "additionalProperties": false,
          "properties": {
            "runtimeUrl": {
              "type": "string"
            }
          }
        }
      ]
    },
    "legal": {
      "description": "The legal documents' current versions and the material changes announced, decided on the server's clock. null unless this deployment is multi-tenant and every document is published. Additive (1.4.0): absent from a response of an earlier release.",
      "oneOf": [
        {
          "type": "null"
        },
        {
          "type": "object",
          "required": [
            "currentVersions",
            "upcoming"
          ],
          "additionalProperties": false,
          "properties": {
            "currentVersions": {
              "type": "object",
              "required": [
                "privacy",
                "terms",
                "dpa"
              ],
              "additionalProperties": false,
              "properties": {
                "privacy": {
                  "type": "string"
                },
                "terms": {
                  "type": "string"
                },
                "dpa": {
                  "type": "string"
                }
              }
            },
            "upcoming": {
              "type": "array",
              "description": "Material changes announced and not yet in force; non-material ones are omitted.",
              "items": {
                "type": "object",
                "required": [
                  "document",
                  "version",
                  "effectiveAt",
                  "changeSummary",
                  "urgent"
                ],
                "additionalProperties": false,
                "properties": {
                  "document": {
                    "type": "string",
                    "enum": [
                      "privacy",
                      "terms",
                      "dpa"
                    ]
                  },
                  "version": {
                    "type": "string"
                  },
                  "effectiveAt": {
                    "type": "string",
                    "description": "ISO instant (UTC) the version takes effect."
                  },
                  "changeSummary": {
                    "type": "string",
                    "description": "English, as published."
                  },
                  "urgent": {
                    "type": "boolean",
                    "description": "True when it takes effect on shorter notice than usual."
                  }
                }
              }
            }
          }
        }
      ]
    }
  }
}