{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/scale-ai/json-schema/scale-ai-agentex-cloud-build-schema.json",
  "title": "AgentexCloudBuild",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/scale-ai-agentex-cloud-build-api-openapi.yml#/components/schemas/AgentexCloudBuild",
  "properties": {
    "id": {
      "type": "string",
      "title": "Id",
      "description": "The unique identifier of the entity."
    },
    "object": {
      "type": "string",
      "const": "agentex_cloud_build",
      "title": "Object",
      "default": "agentex_cloud_build"
    },
    "cloud_provider_build_id": {
      "type": "string",
      "title": "Cloud Provider Build Id",
      "description": "The unique identifier of the build from the cloud provider, or an internal UUID when an existing image is copied without a provider build."
    },
    "agent_name": {
      "type": "string",
      "title": "Agent Name",
      "description": "The name of the agent that this build belongs to"
    },
    "agent_id": {
      "title": "Agent Id",
      "description": "The UUID of the agent that this build belongs to",
      "type": "string"
    },
    "image_name": {
      "type": "string",
      "title": "Image Name",
      "description": "The name of the container image to build."
    },
    "image_tag": {
      "type": "string",
      "title": "Image Tag",
      "description": "The tag for the container image."
    },
    "image_url": {
      "title": "Image Url",
      "description": "The URL of the container image. This is not guaranteed to be present until the build is complete.",
      "type": "string"
    },
    "build_status": {
      "$ref": "#/$defs/AgentexCloudBuildStatus",
      "description": "The current build lifecycle status"
    },
    "build_start_time": {
      "title": "Build Start Time",
      "description": "When the cloud provider started the build",
      "type": "string",
      "format": "date-time"
    },
    "build_end_time": {
      "title": "Build End Time",
      "description": "When the cloud provider finished the build",
      "type": "string",
      "format": "date-time"
    },
    "source_repo": {
      "title": "Source Repo",
      "description": "Normalized git remote the build context came from (host/path, no credentials).",
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "source_commit": {
      "title": "Source Commit",
      "description": "Git commit the build context was at, when a git work tree.",
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "source_ref": {
      "title": "Source Ref",
      "description": "Git branch or tag for source_commit, when resolvable.",
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "source_subpath": {
      "title": "Source Subpath",
      "description": "Build-context path relative to the repo root (which agent, in a monorepo).",
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "working_tree_hash": {
      "title": "Working Tree Hash",
      "description": "Deterministic SHA-256 content hash of the build inputs (not the tarball).",
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "source_dirty": {
      "title": "Source Dirty",
      "description": "Whether the work tree had uncommitted changes at build time (null outside git).",
      "anyOf": [
        {
          "type": "boolean"
        },
        {
          "type": "null"
        }
      ]
    },
    "account_id": {
      "type": "string",
      "title": "Account Id",
      "description": "The ID of the account that owns the given entity."
    },
    "created_at": {
      "type": "string",
      "format": "date-time",
      "title": "Created At",
      "description": "The date and time when the entity was created in ISO format."
    },
    "created_by": {
      "$ref": "#/$defs/Identity",
      "description": "The identity that created the entity."
    }
  },
  "type": "object",
  "required": [
    "cloud_provider_build_id",
    "agent_name",
    "image_name",
    "image_tag",
    "build_status",
    "source_repo",
    "source_commit",
    "source_ref",
    "source_subpath",
    "working_tree_hash",
    "source_dirty",
    "id",
    "account_id",
    "created_at",
    "created_by"
  ],
  "$defs": {
    "AgentexCloudBuildStatus": {
      "type": "string",
      "enum": [
        "queued",
        "running",
        "success",
        "failed",
        "cancelling",
        "cancelled",
        "deleting",
        "delete_failed",
        "timed_out",
        "error",
        "unknown"
      ],
      "title": "AgentexCloudBuildStatus"
    },
    "Identity": {
      "properties": {
        "id": {
          "type": "string",
          "title": "Id"
        },
        "object": {
          "type": "string",
          "const": "identity",
          "title": "Object",
          "default": "identity"
        },
        "type": {
          "$ref": "#/$defs/IdentityType"
        }
      },
      "type": "object",
      "required": [
        "id",
        "type"
      ],
      "title": "Identity"
    },
    "IdentityType": {
      "type": "string",
      "enum": [
        "user",
        "service_account"
      ],
      "title": "IdentityType"
    }
  }
}