# Build

## Submit container image build

`client.build.create(BuildCreateParamsbody, RequestOptionsoptions?): AgentexCloudBuild`

**post** `/v5/builds`

Create a container image build record.

This multipart request accepts exactly one image source. Provide `context_archive`
to stream a tar.gz build context to the configured cloud build provider, or provide
`image_url` to register an existing tagged image as an immediately successful build
without invoking the provider. `build_args` and `platform` apply only to archive
builds.

Exactly one of `agent_name` or `agent_id` must identify the target agent.
`agent_name` creates a new build-only agent and must be unused. `agent_id` targets
an existing agent. Archive builds normally return in a queued or running state;
prebuilt images can immediately be passed to Cloud Deploy using the returned build
ID. Archives must be non-empty and no larger than 500 MB.

### Parameters

- `body: BuildCreateParams`

  - `image_name: string`

    Name for the built image

  - `agent_id?: string`

    ID of the existing agent this build targets

  - `agent_name?: string`

    Name of the brand-new agent to create from this build

  - `build_args?: string`

    JSON string of build arguments

  - `context_archive?: Uploadable`

    tar.gz archive containing the build context (Dockerfile and any files needed for the build)

  - `image_tag?: string`

    Tag for the built image

  - `image_url?: string`

    Existing tagged image to register instead of running a build

  - `platform?: "linux/amd64" | "linux/arm64" | "linux/arm/v7"`

    Target platform for the Docker build. Defaults to the build host's native architecture when not specified.

    - `"linux/amd64"`

    - `"linux/arm64"`

    - `"linux/arm/v7"`

  - `source_commit?: string`

    Git commit the build context was at.

  - `source_dirty?: boolean`

    Whether the work tree had uncommitted changes at build time.

  - `source_ref?: string`

    Git branch or tag for source_commit.

  - `source_repo?: string`

    Normalized git remote the build context came from.

  - `source_subpath?: string`

    Build-context path relative to the repo root.

  - `working_tree_hash?: string`

    Deterministic SHA-256 content hash of the build inputs.

### Returns

- `AgentexCloudBuild`

  - `id: string`

    The unique identifier of the entity.

  - `account_id: string`

    The ID of the account that owns the given entity.

  - `agent_name: string`

    The name of the agent that this build belongs to

  - `build_status: "queued" | "running" | "success" | 8 more`

    The current build lifecycle status

    - `"queued"`

    - `"running"`

    - `"success"`

    - `"failed"`

    - `"cancelling"`

    - `"cancelled"`

    - `"deleting"`

    - `"delete_failed"`

    - `"timed_out"`

    - `"error"`

    - `"unknown"`

  - `cloud_provider_build_id: string`

    The unique identifier of the build from the cloud provider, or an internal UUID when an existing image is copied without a provider build.

  - `created_at: string`

    The date and time when the entity was created in ISO format.

  - `created_by: Identity`

    The identity that created the entity.

    - `id: string`

    - `type: "user" | "service_account"`

      - `"user"`

      - `"service_account"`

    - `object?: "identity"`

      - `"identity"`

  - `image_name: string`

    The name of the container image to build.

  - `image_tag: string`

    The tag for the container image.

  - `source_commit: string | null`

    Git commit the build context was at, when a git work tree.

  - `source_dirty: boolean | null`

    Whether the work tree had uncommitted changes at build time (null outside git).

  - `source_ref: string | null`

    Git branch or tag for source_commit, when resolvable.

  - `source_repo: string | null`

    Normalized git remote the build context came from (host/path, no credentials).

  - `source_subpath: string | null`

    Build-context path relative to the repo root (which agent, in a monorepo).

  - `working_tree_hash: string | null`

    Deterministic SHA-256 content hash of the build inputs (not the tarball).

  - `agent_id?: string`

    The UUID of the agent that this build belongs to

  - `build_end_time?: string`

    When the cloud provider finished the build

  - `build_start_time?: string`

    When the cloud provider started the build

  - `image_url?: string`

    The URL of the container image. This is not guaranteed to be present until the build is complete.

  - `object?: "agentex_cloud_build"`

    - `"agentex_cloud_build"`

### Example

```typescript
import SGPClient from 'scale-gp';

const client = new SGPClient({
  accountID: 'My Account ID',
  apiKey: process.env['SGP_API_KEY'], // This is the default and can be omitted
});

const agentexCloudBuild = await client.build.create({ image_name: 'image_name' });

console.log(agentexCloudBuild.id);
```

#### Response

```json
{
  "id": "id",
  "account_id": "account_id",
  "agent_name": "agent_name",
  "build_status": "queued",
  "cloud_provider_build_id": "cloud_provider_build_id",
  "created_at": "2019-12-27T18:11:19.117Z",
  "created_by": {
    "id": "id",
    "type": "user",
    "object": "identity"
  },
  "image_name": "image_name",
  "image_tag": "image_tag",
  "source_commit": "source_commit",
  "source_dirty": true,
  "source_ref": "source_ref",
  "source_repo": "source_repo",
  "source_subpath": "source_subpath",
  "working_tree_hash": "working_tree_hash",
  "agent_id": "agent_id",
  "build_end_time": "2019-12-27T18:11:19.117Z",
  "build_start_time": "2019-12-27T18:11:19.117Z",
  "image_url": "image_url",
  "object": "agentex_cloud_build"
}
```

## Get a build

`client.build.retrieve(stringbuildID, RequestOptionsoptions?): AgentexCloudBuild`

**get** `/v5/builds/{build_id}`

Retrieve a single build by its ID, including its current lifecycle status.

Because builds run asynchronously after submission, the status returned here reflects the latest known
state and may still be queued or running; call this endpoint again to observe progression to a
terminal state such as success, failed, cancelled, or timed out. Responds with a not-found error if no
such build exists for the caller's account.

### Parameters

- `buildID: string`

### Returns

- `AgentexCloudBuild`

  - `id: string`

    The unique identifier of the entity.

  - `account_id: string`

    The ID of the account that owns the given entity.

  - `agent_name: string`

    The name of the agent that this build belongs to

  - `build_status: "queued" | "running" | "success" | 8 more`

    The current build lifecycle status

    - `"queued"`

    - `"running"`

    - `"success"`

    - `"failed"`

    - `"cancelling"`

    - `"cancelled"`

    - `"deleting"`

    - `"delete_failed"`

    - `"timed_out"`

    - `"error"`

    - `"unknown"`

  - `cloud_provider_build_id: string`

    The unique identifier of the build from the cloud provider, or an internal UUID when an existing image is copied without a provider build.

  - `created_at: string`

    The date and time when the entity was created in ISO format.

  - `created_by: Identity`

    The identity that created the entity.

    - `id: string`

    - `type: "user" | "service_account"`

      - `"user"`

      - `"service_account"`

    - `object?: "identity"`

      - `"identity"`

  - `image_name: string`

    The name of the container image to build.

  - `image_tag: string`

    The tag for the container image.

  - `source_commit: string | null`

    Git commit the build context was at, when a git work tree.

  - `source_dirty: boolean | null`

    Whether the work tree had uncommitted changes at build time (null outside git).

  - `source_ref: string | null`

    Git branch or tag for source_commit, when resolvable.

  - `source_repo: string | null`

    Normalized git remote the build context came from (host/path, no credentials).

  - `source_subpath: string | null`

    Build-context path relative to the repo root (which agent, in a monorepo).

  - `working_tree_hash: string | null`

    Deterministic SHA-256 content hash of the build inputs (not the tarball).

  - `agent_id?: string`

    The UUID of the agent that this build belongs to

  - `build_end_time?: string`

    When the cloud provider finished the build

  - `build_start_time?: string`

    When the cloud provider started the build

  - `image_url?: string`

    The URL of the container image. This is not guaranteed to be present until the build is complete.

  - `object?: "agentex_cloud_build"`

    - `"agentex_cloud_build"`

### Example

```typescript
import SGPClient from 'scale-gp';

const client = new SGPClient({
  accountID: 'My Account ID',
  apiKey: process.env['SGP_API_KEY'], // This is the default and can be omitted
});

const agentexCloudBuild = await client.build.retrieve('build_id');

console.log(agentexCloudBuild.id);
```

#### Response

```json
{
  "id": "id",
  "account_id": "account_id",
  "agent_name": "agent_name",
  "build_status": "queued",
  "cloud_provider_build_id": "cloud_provider_build_id",
  "created_at": "2019-12-27T18:11:19.117Z",
  "created_by": {
    "id": "id",
    "type": "user",
    "object": "identity"
  },
  "image_name": "image_name",
  "image_tag": "image_tag",
  "source_commit": "source_commit",
  "source_dirty": true,
  "source_ref": "source_ref",
  "source_repo": "source_repo",
  "source_subpath": "source_subpath",
  "working_tree_hash": "working_tree_hash",
  "agent_id": "agent_id",
  "build_end_time": "2019-12-27T18:11:19.117Z",
  "build_start_time": "2019-12-27T18:11:19.117Z",
  "image_url": "image_url",
  "object": "agentex_cloud_build"
}
```

## List container image builds

`client.build.list(BuildListParamsquery?, RequestOptionsoptions?): CursorPage<AgentexCloudBuild>`

**get** `/v5/builds`

List container image build records for the caller's account as a paginated collection.

Each entry is one individual build with its current lifecycle status; pass `agent_name`,
`source_commit`, or `working_tree_hash` to return only matching builds. Archived builds are
excluded, and results are limited to builds the caller is permitted to read. Use this to
enumerate individual builds; to instead list agents that have been built but not yet
deployed, use `GET /v5/builds/undeployed`.

### Parameters

- `query: BuildListParams`

  - `agent_name?: string`

    Filter builds by agent name

  - `ending_before?: string`

  - `limit?: number`

  - `sort_by?: string`

  - `sort_order?: SortOrder`

    - `"asc"`

    - `"desc"`

  - `source_commit?: string`

    Filter builds by source git commit

  - `starting_after?: string`

  - `working_tree_hash?: string`

    Filter builds by build-context content hash

### Returns

- `AgentexCloudBuild`

  - `id: string`

    The unique identifier of the entity.

  - `account_id: string`

    The ID of the account that owns the given entity.

  - `agent_name: string`

    The name of the agent that this build belongs to

  - `build_status: "queued" | "running" | "success" | 8 more`

    The current build lifecycle status

    - `"queued"`

    - `"running"`

    - `"success"`

    - `"failed"`

    - `"cancelling"`

    - `"cancelled"`

    - `"deleting"`

    - `"delete_failed"`

    - `"timed_out"`

    - `"error"`

    - `"unknown"`

  - `cloud_provider_build_id: string`

    The unique identifier of the build from the cloud provider, or an internal UUID when an existing image is copied without a provider build.

  - `created_at: string`

    The date and time when the entity was created in ISO format.

  - `created_by: Identity`

    The identity that created the entity.

    - `id: string`

    - `type: "user" | "service_account"`

      - `"user"`

      - `"service_account"`

    - `object?: "identity"`

      - `"identity"`

  - `image_name: string`

    The name of the container image to build.

  - `image_tag: string`

    The tag for the container image.

  - `source_commit: string | null`

    Git commit the build context was at, when a git work tree.

  - `source_dirty: boolean | null`

    Whether the work tree had uncommitted changes at build time (null outside git).

  - `source_ref: string | null`

    Git branch or tag for source_commit, when resolvable.

  - `source_repo: string | null`

    Normalized git remote the build context came from (host/path, no credentials).

  - `source_subpath: string | null`

    Build-context path relative to the repo root (which agent, in a monorepo).

  - `working_tree_hash: string | null`

    Deterministic SHA-256 content hash of the build inputs (not the tarball).

  - `agent_id?: string`

    The UUID of the agent that this build belongs to

  - `build_end_time?: string`

    When the cloud provider finished the build

  - `build_start_time?: string`

    When the cloud provider started the build

  - `image_url?: string`

    The URL of the container image. This is not guaranteed to be present until the build is complete.

  - `object?: "agentex_cloud_build"`

    - `"agentex_cloud_build"`

### Example

```typescript
import SGPClient from 'scale-gp';

const client = new SGPClient({
  accountID: 'My Account ID',
  apiKey: process.env['SGP_API_KEY'], // This is the default and can be omitted
});

// Automatically fetches more pages as needed.
for await (const agentexCloudBuild of client.build.list()) {
  console.log(agentexCloudBuild.id);
}
```

#### Response

```json
{
  "has_more": true,
  "items": [
    {
      "id": "id",
      "account_id": "account_id",
      "agent_name": "agent_name",
      "build_status": "queued",
      "cloud_provider_build_id": "cloud_provider_build_id",
      "created_at": "2019-12-27T18:11:19.117Z",
      "created_by": {
        "id": "id",
        "type": "user",
        "object": "identity"
      },
      "image_name": "image_name",
      "image_tag": "image_tag",
      "source_commit": "source_commit",
      "source_dirty": true,
      "source_ref": "source_ref",
      "source_repo": "source_repo",
      "source_subpath": "source_subpath",
      "working_tree_hash": "working_tree_hash",
      "agent_id": "agent_id",
      "build_end_time": "2019-12-27T18:11:19.117Z",
      "build_start_time": "2019-12-27T18:11:19.117Z",
      "image_url": "image_url",
      "object": "agentex_cloud_build"
    }
  ],
  "total": 0,
  "limit": 0,
  "object": "list"
}
```

## Stream build logs

`client.build.logs(stringbuildID, RequestOptionsoptions?): StreamChunk | Stream<StreamChunk>`

**get** `/v5/builds/{build_id}/logs`

Stream a build's logs as Server-Sent Events.

The response has content-type `text/event-stream`; each event carries one log line as an
`AgentexCloudBuildLogLine` object, delivered as lines become available from the cloud build provider.
The stream ends when the provider stops producing output. Responds with a not-found error if no such
build exists for the caller's account.

### Parameters

- `buildID: string`

### Returns

- `StreamChunk`

  A single log line from the build process.

  - `line: string`

    The log line content

### Example

```typescript
import SGPClient from 'scale-gp';

const client = new SGPClient({
  accountID: 'My Account ID',
  apiKey: process.env['SGP_API_KEY'], // This is the default and can be omitted
});

const streamChunk = await client.build.logs('build_id');

console.log(streamChunk.line);
```

#### Response

```json
{
  "line": "line"
}
```

## Cancel a build

`client.build.cancel(stringbuildID, RequestOptionsoptions?): AgentexCloudBuild`

**post** `/v5/builds/{build_id}/cancel`

Request cancellation of a build and return 202 Accepted.

Cancellation runs asynchronously: the endpoint verifies the build exists and then hands it off to a
background workflow that marks the build as cancelling, asks the cloud build provider to stop it, and
polls until the build reaches a terminal state before recording the final status. Only builds that are
still queued or running are actually cancelled; if the build has already finished, or cancellation is
already in progress, the request is still accepted but has no effect. The returned record reflects the
build's state at the time of the call, so it will not yet show the pending cancellation. The request
is rejected if no such build exists for the caller's account.

### Parameters

- `buildID: string`

### Returns

- `AgentexCloudBuild`

  - `id: string`

    The unique identifier of the entity.

  - `account_id: string`

    The ID of the account that owns the given entity.

  - `agent_name: string`

    The name of the agent that this build belongs to

  - `build_status: "queued" | "running" | "success" | 8 more`

    The current build lifecycle status

    - `"queued"`

    - `"running"`

    - `"success"`

    - `"failed"`

    - `"cancelling"`

    - `"cancelled"`

    - `"deleting"`

    - `"delete_failed"`

    - `"timed_out"`

    - `"error"`

    - `"unknown"`

  - `cloud_provider_build_id: string`

    The unique identifier of the build from the cloud provider, or an internal UUID when an existing image is copied without a provider build.

  - `created_at: string`

    The date and time when the entity was created in ISO format.

  - `created_by: Identity`

    The identity that created the entity.

    - `id: string`

    - `type: "user" | "service_account"`

      - `"user"`

      - `"service_account"`

    - `object?: "identity"`

      - `"identity"`

  - `image_name: string`

    The name of the container image to build.

  - `image_tag: string`

    The tag for the container image.

  - `source_commit: string | null`

    Git commit the build context was at, when a git work tree.

  - `source_dirty: boolean | null`

    Whether the work tree had uncommitted changes at build time (null outside git).

  - `source_ref: string | null`

    Git branch or tag for source_commit, when resolvable.

  - `source_repo: string | null`

    Normalized git remote the build context came from (host/path, no credentials).

  - `source_subpath: string | null`

    Build-context path relative to the repo root (which agent, in a monorepo).

  - `working_tree_hash: string | null`

    Deterministic SHA-256 content hash of the build inputs (not the tarball).

  - `agent_id?: string`

    The UUID of the agent that this build belongs to

  - `build_end_time?: string`

    When the cloud provider finished the build

  - `build_start_time?: string`

    When the cloud provider started the build

  - `image_url?: string`

    The URL of the container image. This is not guaranteed to be present until the build is complete.

  - `object?: "agentex_cloud_build"`

    - `"agentex_cloud_build"`

### Example

```typescript
import SGPClient from 'scale-gp';

const client = new SGPClient({
  accountID: 'My Account ID',
  apiKey: process.env['SGP_API_KEY'], // This is the default and can be omitted
});

const agentexCloudBuild = await client.build.cancel('build_id');

console.log(agentexCloudBuild.id);
```

#### Response

```json
{
  "id": "id",
  "account_id": "account_id",
  "agent_name": "agent_name",
  "build_status": "queued",
  "cloud_provider_build_id": "cloud_provider_build_id",
  "created_at": "2019-12-27T18:11:19.117Z",
  "created_by": {
    "id": "id",
    "type": "user",
    "object": "identity"
  },
  "image_name": "image_name",
  "image_tag": "image_tag",
  "source_commit": "source_commit",
  "source_dirty": true,
  "source_ref": "source_ref",
  "source_repo": "source_repo",
  "source_subpath": "source_subpath",
  "working_tree_hash": "working_tree_hash",
  "agent_id": "agent_id",
  "build_end_time": "2019-12-27T18:11:19.117Z",
  "build_start_time": "2019-12-27T18:11:19.117Z",
  "image_url": "image_url",
  "object": "agentex_cloud_build"
}
```

## List agents built but not deployed

`client.build.listUndeployed(RequestOptionsoptions?): BuildListUndeployedResponse`

**get** `/v5/builds/undeployed`

List agents that exist only as cloud builds and have no healthy deployment yet.

Unlike listing builds, this aggregates by agent: it returns one entry per distinct agent name whose
builds have never reached a healthy deploy, each carrying that agent's most recent build and its total
build count. The result is a plain list (not paginated) and is limited to builds the caller is
permitted to read. Use this to surface agents that were built but still need to be deployed; use
`GET /v5/builds` when you need the individual build records instead.

### Returns

- `BuildListUndeployedResponse = Array<BuildListUndeployedResponseItem>`

  - `agent_name: string`

    The agent name from cloud builds

  - `latest_build: AgentexCloudBuild`

    The most recent cloud build for this agent

    - `id: string`

      The unique identifier of the entity.

    - `account_id: string`

      The ID of the account that owns the given entity.

    - `agent_name: string`

      The name of the agent that this build belongs to

    - `build_status: "queued" | "running" | "success" | 8 more`

      The current build lifecycle status

      - `"queued"`

      - `"running"`

      - `"success"`

      - `"failed"`

      - `"cancelling"`

      - `"cancelled"`

      - `"deleting"`

      - `"delete_failed"`

      - `"timed_out"`

      - `"error"`

      - `"unknown"`

    - `cloud_provider_build_id: string`

      The unique identifier of the build from the cloud provider, or an internal UUID when an existing image is copied without a provider build.

    - `created_at: string`

      The date and time when the entity was created in ISO format.

    - `created_by: Identity`

      The identity that created the entity.

      - `id: string`

      - `type: "user" | "service_account"`

        - `"user"`

        - `"service_account"`

      - `object?: "identity"`

        - `"identity"`

    - `image_name: string`

      The name of the container image to build.

    - `image_tag: string`

      The tag for the container image.

    - `source_commit: string | null`

      Git commit the build context was at, when a git work tree.

    - `source_dirty: boolean | null`

      Whether the work tree had uncommitted changes at build time (null outside git).

    - `source_ref: string | null`

      Git branch or tag for source_commit, when resolvable.

    - `source_repo: string | null`

      Normalized git remote the build context came from (host/path, no credentials).

    - `source_subpath: string | null`

      Build-context path relative to the repo root (which agent, in a monorepo).

    - `working_tree_hash: string | null`

      Deterministic SHA-256 content hash of the build inputs (not the tarball).

    - `agent_id?: string`

      The UUID of the agent that this build belongs to

    - `build_end_time?: string`

      When the cloud provider finished the build

    - `build_start_time?: string`

      When the cloud provider started the build

    - `image_url?: string`

      The URL of the container image. This is not guaranteed to be present until the build is complete.

    - `object?: "agentex_cloud_build"`

      - `"agentex_cloud_build"`

  - `total_builds: number`

    Total number of builds for this agent

### Example

```typescript
import SGPClient from 'scale-gp';

const client = new SGPClient({
  accountID: 'My Account ID',
  apiKey: process.env['SGP_API_KEY'], // This is the default and can be omitted
});

const response = await client.build.listUndeployed();

console.log(response);
```

#### Response

```json
[
  {
    "agent_name": "agent_name",
    "latest_build": {
      "id": "id",
      "account_id": "account_id",
      "agent_name": "agent_name",
      "build_status": "queued",
      "cloud_provider_build_id": "cloud_provider_build_id",
      "created_at": "2019-12-27T18:11:19.117Z",
      "created_by": {
        "id": "id",
        "type": "user",
        "object": "identity"
      },
      "image_name": "image_name",
      "image_tag": "image_tag",
      "source_commit": "source_commit",
      "source_dirty": true,
      "source_ref": "source_ref",
      "source_repo": "source_repo",
      "source_subpath": "source_subpath",
      "working_tree_hash": "working_tree_hash",
      "agent_id": "agent_id",
      "build_end_time": "2019-12-27T18:11:19.117Z",
      "build_start_time": "2019-12-27T18:11:19.117Z",
      "image_url": "image_url",
      "object": "agentex_cloud_build"
    },
    "total_builds": 0
  }
]
```

## Domain Types

### Agentex Cloud Build

- `AgentexCloudBuild`

  - `id: string`

    The unique identifier of the entity.

  - `account_id: string`

    The ID of the account that owns the given entity.

  - `agent_name: string`

    The name of the agent that this build belongs to

  - `build_status: "queued" | "running" | "success" | 8 more`

    The current build lifecycle status

    - `"queued"`

    - `"running"`

    - `"success"`

    - `"failed"`

    - `"cancelling"`

    - `"cancelled"`

    - `"deleting"`

    - `"delete_failed"`

    - `"timed_out"`

    - `"error"`

    - `"unknown"`

  - `cloud_provider_build_id: string`

    The unique identifier of the build from the cloud provider, or an internal UUID when an existing image is copied without a provider build.

  - `created_at: string`

    The date and time when the entity was created in ISO format.

  - `created_by: Identity`

    The identity that created the entity.

    - `id: string`

    - `type: "user" | "service_account"`

      - `"user"`

      - `"service_account"`

    - `object?: "identity"`

      - `"identity"`

  - `image_name: string`

    The name of the container image to build.

  - `image_tag: string`

    The tag for the container image.

  - `source_commit: string | null`

    Git commit the build context was at, when a git work tree.

  - `source_dirty: boolean | null`

    Whether the work tree had uncommitted changes at build time (null outside git).

  - `source_ref: string | null`

    Git branch or tag for source_commit, when resolvable.

  - `source_repo: string | null`

    Normalized git remote the build context came from (host/path, no credentials).

  - `source_subpath: string | null`

    Build-context path relative to the repo root (which agent, in a monorepo).

  - `working_tree_hash: string | null`

    Deterministic SHA-256 content hash of the build inputs (not the tarball).

  - `agent_id?: string`

    The UUID of the agent that this build belongs to

  - `build_end_time?: string`

    When the cloud provider finished the build

  - `build_start_time?: string`

    When the cloud provider started the build

  - `image_url?: string`

    The URL of the container image. This is not guaranteed to be present until the build is complete.

  - `object?: "agentex_cloud_build"`

    - `"agentex_cloud_build"`

### Stream Chunk

- `StreamChunk`

  A single log line from the build process.

  - `line: string`

    The log line content

### Build List Undeployed Response

- `BuildListUndeployedResponse = Array<BuildListUndeployedResponseItem>`

  - `agent_name: string`

    The agent name from cloud builds

  - `latest_build: AgentexCloudBuild`

    The most recent cloud build for this agent

    - `id: string`

      The unique identifier of the entity.

    - `account_id: string`

      The ID of the account that owns the given entity.

    - `agent_name: string`

      The name of the agent that this build belongs to

    - `build_status: "queued" | "running" | "success" | 8 more`

      The current build lifecycle status

      - `"queued"`

      - `"running"`

      - `"success"`

      - `"failed"`

      - `"cancelling"`

      - `"cancelled"`

      - `"deleting"`

      - `"delete_failed"`

      - `"timed_out"`

      - `"error"`

      - `"unknown"`

    - `cloud_provider_build_id: string`

      The unique identifier of the build from the cloud provider, or an internal UUID when an existing image is copied without a provider build.

    - `created_at: string`

      The date and time when the entity was created in ISO format.

    - `created_by: Identity`

      The identity that created the entity.

      - `id: string`

      - `type: "user" | "service_account"`

        - `"user"`

        - `"service_account"`

      - `object?: "identity"`

        - `"identity"`

    - `image_name: string`

      The name of the container image to build.

    - `image_tag: string`

      The tag for the container image.

    - `source_commit: string | null`

      Git commit the build context was at, when a git work tree.

    - `source_dirty: boolean | null`

      Whether the work tree had uncommitted changes at build time (null outside git).

    - `source_ref: string | null`

      Git branch or tag for source_commit, when resolvable.

    - `source_repo: string | null`

      Normalized git remote the build context came from (host/path, no credentials).

    - `source_subpath: string | null`

      Build-context path relative to the repo root (which agent, in a monorepo).

    - `working_tree_hash: string | null`

      Deterministic SHA-256 content hash of the build inputs (not the tarball).

    - `agent_id?: string`

      The UUID of the agent that this build belongs to

    - `build_end_time?: string`

      When the cloud provider finished the build

    - `build_start_time?: string`

      When the cloud provider started the build

    - `image_url?: string`

      The URL of the container image. This is not guaranteed to be present until the build is complete.

    - `object?: "agentex_cloud_build"`

      - `"agentex_cloud_build"`

  - `total_builds: number`

    Total number of builds for this agent
