{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/daystruct-ai/json-schema/daystruct-ai-developer-agent-envelope-schema.json",
  "title": "DeveloperAgentEnvelope",
  "x-generated": "2026-11-05",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/daystruct-ai-openapi.json#/components/schemas/DeveloperAgentEnvelope",
  "type": "object",
  "required": [
    "data",
    "meta"
  ],
  "properties": {
    "data": {
      "$ref": "#/$defs/DeveloperAgent"
    },
    "meta": {
      "type": "object"
    }
  },
  "$defs": {
    "DeveloperAgent": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "id",
        "ownerAccountId",
        "slug",
        "displayName",
        "description",
        "status",
        "capabilities",
        "routable",
        "createdAt",
        "updatedAt",
        "lastSeenAt",
        "keyAssociation"
      ],
      "properties": {
        "id": {
          "type": "string",
          "format": "uuid"
        },
        "ownerAccountId": {
          "type": "string",
          "format": "uuid"
        },
        "slug": {
          "type": "string"
        },
        "displayName": {
          "type": "string"
        },
        "description": {
          "type": "string"
        },
        "status": {
          "type": "string",
          "enum": [
            "active",
            "disabled"
          ]
        },
        "capabilities": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/DeveloperAgentCapability"
          }
        },
        "routable": {
          "type": "boolean",
          "const": false,
          "description": "Always false. Registration creates identity and attribution only; it does not enable routing or task dispatch."
        },
        "createdAt": {
          "type": "string",
          "format": "date-time"
        },
        "updatedAt": {
          "type": "string",
          "format": "date-time"
        },
        "lastSeenAt": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time"
        },
        "keyAssociation": {
          "type": "object",
          "additionalProperties": false,
          "required": [
            "apiKeyId",
            "linked"
          ],
          "properties": {
            "apiKeyId": {
              "type": "string",
              "format": "uuid"
            },
            "linked": {
              "type": "boolean",
              "const": true
            }
          }
        }
      }
    },
    "DeveloperAgentCapability": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "id",
        "description",
        "state"
      ],
      "properties": {
        "id": {
          "type": "string",
          "minLength": 3,
          "maxLength": 100,
          "pattern": "^[a-z][a-z0-9-]*(?:\\.[a-z][a-z0-9-]*)+$"
        },
        "description": {
          "type": "string",
          "minLength": 1,
          "maxLength": 500
        },
        "state": {
          "type": "string",
          "const": "declared"
        }
      }
    }
  }
}