{
  "components": {
    "schemas": {
      "ACPType": {
        "description": "Type of ACP server.",
        "enum": [
          "sync",
          "async"
        ],
        "title": "ACPType",
        "type": "string"
      },
      "AccessGroup": {
        "properties": {
          "created_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Creation timestamp.",
            "title": "Created At"
          },
          "created_by": {
            "description": "member_id of the creator.",
            "title": "Created By",
            "type": "string"
          },
          "description": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Optional group description.",
            "title": "Description"
          },
          "id": {
            "description": "Access group id.",
            "title": "Id",
            "type": "string"
          },
          "name": {
            "description": "Group name.",
            "title": "Name",
            "type": "string"
          },
          "owner_org_id": {
            "description": "Owner organization id.",
            "title": "Owner Org Id",
            "type": "string"
          },
          "updated_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Last update timestamp.",
            "title": "Updated At"
          }
        },
        "required": [
          "id",
          "owner_org_id",
          "name",
          "created_by"
        ],
        "title": "AccessGroup",
        "type": "object"
      },
      "AccessGroupListResponse": {
        "properties": {
          "groups": {
            "items": {
              "$ref": "#/components/schemas/AccessGroup"
            },
            "title": "Groups",
            "type": "array"
          }
        },
        "title": "AccessGroupListResponse",
        "type": "object"
      },
      "AccessGroupManager": {
        "properties": {
          "created_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Creation timestamp.",
            "title": "Created At"
          },
          "group_id": {
            "description": "Access group id.",
            "title": "Group Id",
            "type": "string"
          },
          "id": {
            "description": "Group manager row id.",
            "title": "Id",
            "type": "string"
          },
          "member_id": {
            "description": "WorkOS member id.",
            "title": "Member Id",
            "type": "string"
          }
        },
        "required": [
          "id",
          "group_id",
          "member_id"
        ],
        "title": "AccessGroupManager",
        "type": "object"
      },
      "AccessGroupManagersResponse": {
        "properties": {
          "managers": {
            "items": {
              "$ref": "#/components/schemas/AccessGroupManager"
            },
            "title": "Managers",
            "type": "array"
          }
        },
        "title": "AccessGroupManagersResponse",
        "type": "object"
      },
      "AccessGroupMember": {
        "properties": {
          "created_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Creation timestamp.",
            "title": "Created At"
          },
          "group_id": {
            "description": "Access group id.",
            "title": "Group Id",
            "type": "string"
          },
          "id": {
            "description": "Group membership row id.",
            "title": "Id",
            "type": "string"
          },
          "member_id": {
            "description": "WorkOS member id.",
            "title": "Member Id",
            "type": "string"
          }
        },
        "required": [
          "id",
          "group_id",
          "member_id"
        ],
        "title": "AccessGroupMember",
        "type": "object"
      },
      "AccessGroupMembersResponse": {
        "properties": {
          "members": {
            "items": {
              "$ref": "#/components/schemas/AccessGroupMember"
            },
            "title": "Members",
            "type": "array"
          }
        },
        "title": "AccessGroupMembersResponse",
        "type": "object"
      },
      "AccessGroupVisibleOrg": {
        "properties": {
          "created_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Creation timestamp.",
            "title": "Created At"
          },
          "group_id": {
            "description": "Access group id.",
            "title": "Group Id",
            "type": "string"
          },
          "id": {
            "description": "Visible org row id.",
            "title": "Id",
            "type": "string"
          },
          "org_id": {
            "description": "Organization id with visibility.",
            "title": "Org Id",
            "type": "string"
          }
        },
        "required": [
          "id",
          "group_id",
          "org_id"
        ],
        "title": "AccessGroupVisibleOrg",
        "type": "object"
      },
      "AccessGroupVisibleOrgsResponse": {
        "properties": {
          "visible_orgs": {
            "items": {
              "$ref": "#/components/schemas/AccessGroupVisibleOrg"
            },
            "title": "Visible Orgs",
            "type": "array"
          }
        },
        "title": "AccessGroupVisibleOrgsResponse",
        "type": "object"
      },
      "Agent": {
        "properties": {
          "agent_input_type": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/AgentInputType"
              },
              {
                "type": "null"
              }
            ],
            "description": "The type of input the agent expects."
          },
          "created_at": {
            "description": "The timestamp when the agent was created",
            "format": "date-time",
            "title": "Created At",
            "type": "string"
          },
          "description": {
            "description": "The description of the action.",
            "title": "Description",
            "type": "string"
          },
          "id": {
            "description": "The unique identifier of the agent.",
            "title": "Id",
            "type": "string"
          },
          "name": {
            "description": "The agent name (unique within namespace).",
            "title": "Name",
            "type": "string"
          },
          "namespace_id": {
            "description": "The namespace ID this agent belongs to.",
            "title": "Namespace Id",
            "type": "string"
          },
          "registered_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "The timestamp when the agent was last registered",
            "title": "Registered At"
          },
          "registration_metadata": {
            "additionalProperties": true,
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "description": "The metadata for the agent's registration.",
            "title": "Registration Metadata"
          },
          "status": {
            "$ref": "#/components/schemas/AgentStatus",
            "default": "ACTIVE",
            "description": "Agent status. Runtime statuses (Ready/Failed/Unhealthy) now live on Deployment."
          },
          "status_reason": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "The reason for the status of the action.",
            "title": "Status Reason"
          },
          "updated_at": {
            "description": "The timestamp when the agent was last updated",
            "format": "date-time",
            "title": "Updated At",
            "type": "string"
          }
        },
        "required": [
          "id",
          "namespace_id",
          "name",
          "description",
          "created_at",
          "updated_at"
        ],
        "title": "Agent",
        "type": "object"
      },
      "AgentAPIKey": {
        "properties": {
          "agent_id": {
            "description": "The UUID of the agent",
            "title": "Agent Id",
            "type": "string"
          },
          "api_key_type": {
            "$ref": "#/components/schemas/AgentAPIKeyType",
            "description": "The type of the agent API key (either internal or external)"
          },
          "created_at": {
            "description": "When the agent API key was created",
            "format": "date-time",
            "title": "Created At",
            "type": "string"
          },
          "id": {
            "description": "The unique identifier of the agent API key.",
            "title": "Id",
            "type": "string"
          },
          "name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "The optional name of the agent API key.",
            "title": "Name"
          }
        },
        "required": [
          "id",
          "agent_id",
          "created_at",
          "name",
          "api_key_type"
        ],
        "title": "AgentAPIKey",
        "type": "object"
      },
      "AgentAPIKeyType": {
        "enum": [
          "internal",
          "external",
          "github",
          "slack"
        ],
        "title": "AgentAPIKeyType",
        "type": "string"
      },
      "AgentInputType": {
        "enum": [
          "text",
          "json"
        ],
        "title": "AgentInputType",
        "type": "string"
      },
      "AgentListItem": {
        "description": "Minimal agent shape for discovery/listing.\n\nThe /agents list endpoint is authorized via `discover` and must not leak\nread-level fields (e.g. description, registration metadata).",
        "properties": {
          "id": {
            "description": "The unique identifier of the agent.",
            "title": "Id",
            "type": "string"
          },
          "name": {
            "description": "The agent name (unique within namespace).",
            "title": "Name",
            "type": "string"
          },
          "namespace_id": {
            "description": "The namespace ID this agent belongs to.",
            "title": "Namespace Id",
            "type": "string"
          },
          "status": {
            "$ref": "#/components/schemas/AgentStatus",
            "default": "ACTIVE",
            "description": "Agent status (ACTIVE/DELETED)."
          }
        },
        "required": [
          "id",
          "namespace_id",
          "name"
        ],
        "title": "AgentListItem",
        "type": "object"
      },
      "AgentMetricsResponse": {
        "description": "Aggregated metrics for an agent.",
        "properties": {
          "avg_task_duration_seconds": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "description": "Average duration of completed/failed tasks in seconds. None if no tasks have finished in the time window.",
            "examples": [
              12.5
            ],
            "title": "Avg Task Duration Seconds"
          },
          "error_log_count_24h": {
            "description": "Number of ERROR/CRITICAL level logs in the last 24 hours",
            "examples": [
              3
            ],
            "title": "Error Log Count 24H",
            "type": "integer"
          },
          "task_count_24h": {
            "description": "Total number of tasks created in the last 24 hours",
            "examples": [
              142
            ],
            "title": "Task Count 24H",
            "type": "integer"
          },
          "task_success_rate_pct": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "description": "Percentage of successful tasks (COMPLETED) vs failed tasks. None if no tasks have finished in the time window.",
            "examples": [
              95.5
            ],
            "title": "Task Success Rate Pct"
          }
        },
        "required": [
          "task_count_24h",
          "error_log_count_24h"
        ],
        "title": "AgentMetricsResponse",
        "type": "object"
      },
      "AgentStatus": {
        "description": "Agent status - runtime statuses (Ready/Failed/Unhealthy) now live on Deployment.",
        "enum": [
          "ACTIVE",
          "DELETED"
        ],
        "title": "AgentStatus",
        "type": "string"
      },
      "AgentTaskTracker": {
        "properties": {
          "agent_id": {
            "description": "The UUID of the agent",
            "title": "Agent Id",
            "type": "string"
          },
          "created_at": {
            "description": "When the agent task tracker was created",
            "format": "date-time",
            "title": "Created At",
            "type": "string"
          },
          "id": {
            "description": "The UUID of the agent task tracker",
            "title": "Id",
            "type": "string"
          },
          "last_processed_event_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "The last processed event ID",
            "title": "Last Processed Event Id"
          },
          "status": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Processing status",
            "title": "Status"
          },
          "status_reason": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Optional status reason",
            "title": "Status Reason"
          },
          "task_id": {
            "description": "The UUID of the task",
            "title": "Task Id",
            "type": "string"
          },
          "updated_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "When the agent task tracker was last updated",
            "title": "Updated At"
          }
        },
        "required": [
          "id",
          "agent_id",
          "task_id",
          "created_at"
        ],
        "title": "AgentTaskTracker",
        "type": "object"
      },
      "ApiKeyCreateRequest": {
        "description": "Request model for creating an API key.",
        "properties": {
          "description": {
            "anyOf": [
              {
                "maxLength": 1000,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Optional description.",
            "title": "Description"
          },
          "name": {
            "description": "Human-readable name for the API key.",
            "maxLength": 256,
            "minLength": 1,
            "title": "Name",
            "type": "string"
          },
          "scopes": {
            "description": "List of resource scopes. At least one scope is required.",
            "items": {
              "$ref": "#/components/schemas/ApiKeyScope"
            },
            "minItems": 1,
            "title": "Scopes",
            "type": "array"
          },
          "sharing_group_ids": {
            "description": "IDs of groups that receive default admin grants on key-created resources.",
            "items": {
              "type": "string"
            },
            "minItems": 1,
            "title": "Sharing Group Ids",
            "type": "array"
          }
        },
        "required": [
          "name",
          "scopes",
          "sharing_group_ids"
        ],
        "title": "ApiKeyCreateRequest",
        "type": "object"
      },
      "ApiKeyCreateResponse": {
        "description": "Response model for API key creation.\n\nIncludes the full API key (shown only once).",
        "properties": {
          "api_key": {
            "$ref": "#/components/schemas/ApiKeyResponse",
            "description": "The created API key metadata."
          },
          "key": {
            "description": "The full API key. Store securely - it will NOT be shown again.",
            "title": "Key",
            "type": "string"
          }
        },
        "required": [
          "api_key",
          "key"
        ],
        "title": "ApiKeyCreateResponse",
        "type": "object"
      },
      "ApiKeyListResponse": {
        "description": "Response model for listing API keys.",
        "properties": {
          "api_keys": {
            "description": "List of API keys.",
            "items": {
              "$ref": "#/components/schemas/ApiKeyResponse"
            },
            "title": "Api Keys",
            "type": "array"
          }
        },
        "title": "ApiKeyListResponse",
        "type": "object"
      },
      "ApiKeyResponse": {
        "description": "Response model for API key (excludes sensitive data).",
        "properties": {
          "created_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "When the key was created.",
            "title": "Created At"
          },
          "created_by": {
            "description": "member_id of the creator.",
            "title": "Created By",
            "type": "string"
          },
          "description": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Optional description.",
            "title": "Description"
          },
          "id": {
            "description": "The unique identifier of the API key.",
            "title": "Id",
            "type": "string"
          },
          "key_prefix": {
            "description": "Display prefix (e.g., 'sk_tu_abc...').",
            "title": "Key Prefix",
            "type": "string"
          },
          "last_used_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "When the key was last used.",
            "title": "Last Used At"
          },
          "name": {
            "description": "Human-readable name for the API key.",
            "title": "Name",
            "type": "string"
          },
          "org_id": {
            "description": "WorkOS organization ID.",
            "title": "Org Id",
            "type": "string"
          },
          "revoked_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "When the key was revoked (soft delete).",
            "title": "Revoked At"
          },
          "scopes": {
            "description": "List of resource scopes for this API key.",
            "items": {
              "$ref": "#/components/schemas/ApiKeyScope"
            },
            "title": "Scopes",
            "type": "array"
          },
          "sharing_group_ids": {
            "description": "Groups that receive default admin grants on resources created by this key.",
            "items": {
              "type": "string"
            },
            "title": "Sharing Group Ids",
            "type": "array"
          }
        },
        "required": [
          "id",
          "org_id",
          "key_prefix",
          "name",
          "created_by"
        ],
        "title": "ApiKeyResponse",
        "type": "object"
      },
      "ApiKeyScope": {
        "description": "Scope definition for an API key - defines resource and role access.",
        "properties": {
          "resource_id": {
            "description": "ID of the resource.",
            "title": "Resource Id",
            "type": "string"
          },
          "resource_type": {
            "description": "Type of resource (namespace, project, agent).",
            "title": "Resource Type",
            "type": "string"
          },
          "role": {
            "$ref": "#/components/schemas/ApiKeyScopeRole",
            "description": "Role for this resource."
          }
        },
        "required": [
          "resource_type",
          "resource_id",
          "role"
        ],
        "title": "ApiKeyScope",
        "type": "object"
      },
      "ApiKeyScopeRole": {
        "description": "Role that can be assigned to an API key for a scoped resource.",
        "enum": [
          "discoverer",
          "viewer",
          "editor",
          "admin",
          "owner",
          "member",
          "executor"
        ],
        "title": "ApiKeyScopeRole",
        "type": "string"
      },
      "ApiKeyScopesUpdateRequest": {
        "description": "Request model for updating API key scopes.",
        "properties": {
          "scopes": {
            "description": "Updated list of resource scopes.",
            "items": {
              "$ref": "#/components/schemas/ApiKeyScope"
            },
            "minItems": 1,
            "title": "Scopes",
            "type": "array"
          }
        },
        "required": [
          "scopes"
        ],
        "title": "ApiKeyScopesUpdateRequest",
        "type": "object"
      },
      "ApiKeySharingGroupsUpdateRequest": {
        "description": "Request model for updating API key sharing groups.",
        "properties": {
          "sharing_group_ids": {
            "description": "Replacement sharing groups (future creations only).",
            "items": {
              "type": "string"
            },
            "minItems": 1,
            "title": "Sharing Group Ids",
            "type": "array"
          }
        },
        "required": [
          "sharing_group_ids"
        ],
        "title": "ApiKeySharingGroupsUpdateRequest",
        "type": "object"
      },
      "BranchListResponse": {
        "description": "Response for listing branches.",
        "properties": {
          "branches": {
            "description": "List of branches",
            "items": {
              "$ref": "#/components/schemas/BranchResponse"
            },
            "title": "Branches",
            "type": "array"
          },
          "total": {
            "description": "Total count",
            "title": "Total",
            "type": "integer"
          }
        },
        "required": [
          "branches",
          "total"
        ],
        "title": "BranchListResponse",
        "type": "object"
      },
      "BranchResponse": {
        "description": "Full branch details including current version.",
        "properties": {
          "agent_id": {
            "description": "Parent agent ID",
            "title": "Agent Id",
            "type": "string"
          },
          "created_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Creation timestamp",
            "title": "Created At"
          },
          "current_version": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/VersionSummary"
              },
              {
                "type": "null"
              }
            ],
            "description": "Currently active version (includes status)"
          },
          "git_branch": {
            "description": "Original git branch name",
            "title": "Git Branch",
            "type": "string"
          },
          "git_branch_normalized": {
            "description": "DNS-safe branch name",
            "title": "Git Branch Normalized",
            "type": "string"
          },
          "id": {
            "description": "Branch ID",
            "title": "Id",
            "type": "string"
          },
          "replicas": {
            "description": "Desired replica count",
            "title": "Replicas",
            "type": "integer"
          },
          "retired_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "When branch was retired",
            "title": "Retired At"
          },
          "retired_reason": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Reason for retirement",
            "title": "Retired Reason"
          },
          "updated_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Last update timestamp",
            "title": "Updated At"
          }
        },
        "required": [
          "id",
          "agent_id",
          "git_branch",
          "git_branch_normalized",
          "replicas"
        ],
        "title": "BranchResponse",
        "type": "object"
      },
      "BuildPrepareRequest": {
        "description": "Prepare a remote build by issuing a presigned upload URL for build context.",
        "properties": {
          "agent_name": {
            "description": "Agent short name (without namespace prefix)",
            "examples": [
              "my-agent"
            ],
            "maxLength": 64,
            "minLength": 1,
            "title": "Agent Name",
            "type": "string"
          },
          "namespace": {
            "description": "Target namespace slug for the build",
            "examples": [
              "acme",
              "my-org"
            ],
            "maxLength": 64,
            "minLength": 1,
            "title": "Namespace",
            "type": "string"
          },
          "tag": {
            "description": "Image tag to build/push (typically git hash)",
            "examples": [
              "abc123def456"
            ],
            "maxLength": 128,
            "minLength": 1,
            "title": "Tag",
            "type": "string"
          }
        },
        "required": [
          "namespace",
          "agent_name",
          "tag"
        ],
        "title": "BuildPrepareRequest",
        "type": "object"
      },
      "BuildPrepareResponse": {
        "description": "Response containing a presigned URL for uploading build context.",
        "properties": {
          "bucket": {
            "description": "GCS bucket where the context will be stored.",
            "title": "Bucket",
            "type": "string"
          },
          "content_type": {
            "description": "Content-Type header that must be used for the upload.",
            "examples": [
              "application/gzip"
            ],
            "title": "Content Type",
            "type": "string"
          },
          "expires_at": {
            "description": "When the presigned URL expires.",
            "format": "date-time",
            "title": "Expires At",
            "type": "string"
          },
          "image_url": {
            "description": "Full Artifact Registry image URL that the build will push.",
            "title": "Image Url",
            "type": "string"
          },
          "instructions": {
            "description": "Human instructions for how to upload the context archive.",
            "title": "Instructions",
            "type": "string"
          },
          "method": {
            "default": "PUT",
            "description": "HTTP method to use for the upload.",
            "title": "Method",
            "type": "string"
          },
          "object_key": {
            "description": "GCS object key where the context will be stored.",
            "title": "Object Key",
            "type": "string"
          },
          "upload_url": {
            "description": "Presigned PUT URL for uploading the build context archive.",
            "title": "Upload Url",
            "type": "string"
          }
        },
        "required": [
          "upload_url",
          "expires_at",
          "content_type",
          "instructions",
          "bucket",
          "object_key",
          "image_url"
        ],
        "title": "BuildPrepareResponse",
        "type": "object"
      },
      "BuildStatusResponse": {
        "description": "Build status response (proxied from Cloud Build).",
        "properties": {
          "build_id": {
            "description": "Cloud Build build ID.",
            "title": "Build Id",
            "type": "string"
          },
          "cloud_status": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Raw Cloud Build status value.",
            "title": "Cloud Status"
          },
          "failure_message": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Failure message if build failed (best-effort).",
            "title": "Failure Message"
          },
          "image_url": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Image URL for this build (if encoded in build).",
            "title": "Image Url"
          },
          "log_url": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Cloud Build log URL (if available).",
            "title": "Log Url"
          },
          "status": {
            "description": "Normalized status (queued|building|succeeded|failed|canceled|timed_out|unknown).",
            "title": "Status",
            "type": "string"
          }
        },
        "required": [
          "build_id",
          "status"
        ],
        "title": "BuildStatusResponse",
        "type": "object"
      },
      "BuildSubmitRequest": {
        "description": "Submit a Cloud Build build for a previously uploaded build context.",
        "properties": {
          "agent_name": {
            "description": "Agent short name",
            "maxLength": 64,
            "minLength": 1,
            "title": "Agent Name",
            "type": "string"
          },
          "bucket": {
            "description": "GCS bucket containing uploaded build context archive.",
            "title": "Bucket",
            "type": "string"
          },
          "git_branch": {
            "anyOf": [
              {
                "maxLength": 256,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Optional git branch name for metadata.",
            "title": "Git Branch"
          },
          "git_hash": {
            "anyOf": [
              {
                "maxLength": 40,
                "minLength": 7,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Optional git hash for metadata.",
            "title": "Git Hash"
          },
          "namespace": {
            "description": "Target namespace slug",
            "maxLength": 64,
            "minLength": 1,
            "title": "Namespace",
            "type": "string"
          },
          "object_key": {
            "description": "GCS object key for the uploaded build context archive.",
            "title": "Object Key",
            "type": "string"
          },
          "tag": {
            "description": "Image tag to build/push",
            "maxLength": 128,
            "minLength": 1,
            "title": "Tag",
            "type": "string"
          }
        },
        "required": [
          "namespace",
          "agent_name",
          "tag",
          "bucket",
          "object_key"
        ],
        "title": "BuildSubmitRequest",
        "type": "object"
      },
      "BuildSubmitResponse": {
        "description": "Response after submitting a Cloud Build build.",
        "properties": {
          "build_id": {
            "description": "Cloud Build build ID (use for status polling).",
            "title": "Build Id",
            "type": "string"
          },
          "image_url": {
            "description": "Full Artifact Registry image URL that the build will push.",
            "title": "Image Url",
            "type": "string"
          },
          "log_url": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Cloud Build log URL (if available).",
            "title": "Log Url"
          }
        },
        "required": [
          "build_id",
          "image_url"
        ],
        "title": "BuildSubmitResponse",
        "type": "object"
      },
      "CLIRefreshRequest": {
        "description": "Request body for CLI token refresh.",
        "properties": {
          "refresh_token": {
            "description": "Refresh token from previous authentication",
            "title": "Refresh Token",
            "type": "string"
          }
        },
        "required": [
          "refresh_token"
        ],
        "title": "CLIRefreshRequest",
        "type": "object"
      },
      "CLIRefreshResponse": {
        "description": "Response for CLI token refresh.",
        "properties": {
          "expires_in": {
            "description": "Token expiration in seconds",
            "title": "Expires In",
            "type": "integer"
          },
          "refresh_token": {
            "description": "New refresh token (replaces the old one)",
            "title": "Refresh Token",
            "type": "string"
          },
          "session_jwt": {
            "description": "New session JWT (WorkOS access token)",
            "title": "Session Jwt",
            "type": "string"
          }
        },
        "required": [
          "session_jwt",
          "refresh_token",
          "expires_in"
        ],
        "title": "CLIRefreshResponse",
        "type": "object"
      },
      "CLITokenRequest": {
        "description": "Request body for CLI token exchange with PKCE.",
        "properties": {
          "code": {
            "description": "Authorization code from OAuth callback",
            "title": "Code",
            "type": "string"
          },
          "code_verifier": {
            "description": "PKCE code verifier",
            "title": "Code Verifier",
            "type": "string"
          }
        },
        "required": [
          "code",
          "code_verifier"
        ],
        "title": "CLITokenRequest",
        "type": "object"
      },
      "CLITokenResponse": {
        "description": "Response for CLI token exchange.",
        "properties": {
          "email": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "User email",
            "title": "Email"
          },
          "expires_in": {
            "description": "Token expiration in seconds",
            "title": "Expires In",
            "type": "integer"
          },
          "member_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "User ID from WorkOS",
            "title": "Member Id"
          },
          "name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "User display name",
            "title": "Name"
          },
          "org_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Organization ID (if applicable)",
            "title": "Org Id"
          },
          "refresh_token": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Refresh token for obtaining new access tokens",
            "title": "Refresh Token"
          },
          "session_jwt": {
            "description": "Session JWT (WorkOS access token)",
            "title": "Session Jwt",
            "type": "string"
          }
        },
        "required": [
          "session_jwt",
          "expires_in"
        ],
        "title": "CLITokenResponse",
        "type": "object"
      },
      "CreateAPIKeyRequest": {
        "properties": {
          "agent_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "The UUID of the agent",
            "title": "Agent Id"
          },
          "agent_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "The name of the agent - if not provided, the agent_id must be set.",
            "title": "Agent Name"
          },
          "api_key": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Optionally provide the API key value - if not set, one will be generated.",
            "title": "Api Key"
          },
          "api_key_type": {
            "$ref": "#/components/schemas/AgentAPIKeyType",
            "default": "external",
            "description": "The type of the agent API key (external by default)."
          },
          "name": {
            "description": "The name of the agent's API key.",
            "title": "Name",
            "type": "string"
          }
        },
        "required": [
          "name"
        ],
        "title": "CreateAPIKeyRequest",
        "type": "object"
      },
      "CreateAPIKeyResponse": {
        "properties": {
          "agent_id": {
            "description": "The UUID of the agent",
            "title": "Agent Id",
            "type": "string"
          },
          "api_key": {
            "description": "The value of the newly created API key.",
            "title": "Api Key",
            "type": "string"
          },
          "api_key_type": {
            "$ref": "#/components/schemas/AgentAPIKeyType",
            "description": "The type of the created agent API key (external)."
          },
          "created_at": {
            "description": "When the agent API key was created",
            "format": "date-time",
            "title": "Created At",
            "type": "string"
          },
          "id": {
            "description": "The unique identifier of the agent API key.",
            "title": "Id",
            "type": "string"
          },
          "name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "The optional name of the agent API key.",
            "title": "Name"
          }
        },
        "required": [
          "id",
          "agent_id",
          "created_at",
          "name",
          "api_key_type",
          "api_key"
        ],
        "title": "CreateAPIKeyResponse",
        "type": "object"
      },
      "CreateAccessGroupRequest": {
        "properties": {
          "description": {
            "anyOf": [
              {
                "maxLength": 1000,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Optional group description.",
            "title": "Description"
          },
          "name": {
            "description": "Group name (unique within owner org).",
            "maxLength": 255,
            "minLength": 1,
            "title": "Name",
            "type": "string"
          }
        },
        "required": [
          "name"
        ],
        "title": "CreateAccessGroupRequest",
        "type": "object"
      },
      "CreateEnvRequest": {
        "description": "Request to create a new environment.",
        "properties": {
          "branch_rules": {
            "description": "Branch patterns for matching (e.g., ['feature/*'], ['develop'])",
            "items": {
              "type": "string"
            },
            "minItems": 1,
            "title": "Branch Rules",
            "type": "array"
          },
          "name": {
            "description": "Environment name (lowercase alphanumeric and hyphens only)",
            "maxLength": 100,
            "minLength": 1,
            "pattern": "^[a-z0-9-]+$",
            "title": "Name",
            "type": "string"
          }
        },
        "required": [
          "name",
          "branch_rules"
        ],
        "title": "CreateEnvRequest",
        "type": "object"
      },
      "CreateNamespaceRequest": {
        "description": "Request model for creating a namespace.",
        "properties": {
          "name": {
            "description": "Human-readable name.",
            "maxLength": 255,
            "minLength": 1,
            "title": "Name",
            "type": "string"
          },
          "owner_org_id": {
            "description": "WorkOS organization ID that owns this namespace.",
            "title": "Owner Org Id",
            "type": "string"
          },
          "slug": {
            "description": "URL-friendly unique identifier (lowercase alphanumeric and hyphens).",
            "maxLength": 63,
            "minLength": 3,
            "pattern": "^[a-z0-9][a-z0-9-]*[a-z0-9]$",
            "title": "Slug",
            "type": "string"
          }
        },
        "required": [
          "slug",
          "name",
          "owner_org_id"
        ],
        "title": "CreateNamespaceRequest",
        "type": "object"
      },
      "CreateOrganizationInvitationRequest": {
        "description": "Request model for creating organization invitations.",
        "properties": {
          "email": {
            "description": "Invitee email",
            "title": "Email",
            "type": "string"
          },
          "role_slug": {
            "default": "member",
            "description": "Organization role slug for the invited member",
            "enum": [
              "admin",
              "member"
            ],
            "title": "Role Slug",
            "type": "string"
          }
        },
        "required": [
          "email"
        ],
        "title": "CreateOrganizationInvitationRequest",
        "type": "object"
      },
      "CreateOrganizationInvitationResponse": {
        "description": "Response model for create invitation endpoint.",
        "properties": {
          "already_exists": {
            "default": false,
            "description": "True when a pending invite already exists for this email",
            "title": "Already Exists",
            "type": "boolean"
          },
          "invitation": {
            "$ref": "#/components/schemas/OrganizationInvitationResponse"
          }
        },
        "required": [
          "invitation"
        ],
        "title": "CreateOrganizationInvitationResponse",
        "type": "object"
      },
      "CreateProjectRequest": {
        "description": "Request model for creating a project.",
        "properties": {
          "description": {
            "anyOf": [
              {
                "maxLength": 1000,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Optional project description.",
            "title": "Description"
          },
          "name": {
            "description": "Project name (unique within namespace).",
            "maxLength": 255,
            "minLength": 1,
            "title": "Name",
            "type": "string"
          },
          "namespace_id": {
            "description": "The namespace this project belongs to.",
            "title": "Namespace Id",
            "type": "string"
          }
        },
        "required": [
          "namespace_id",
          "name"
        ],
        "title": "CreateProjectRequest",
        "type": "object"
      },
      "CreateScheduleRequest": {
        "description": "Request model for creating a new schedule for an agent",
        "properties": {
          "cron_expression": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Cron expression for scheduling (e.g., '0 0 * * 0' for weekly on Sunday)",
            "title": "Cron Expression"
          },
          "end_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "When the schedule should stop being active",
            "title": "End At"
          },
          "execution_timeout_seconds": {
            "anyOf": [
              {
                "minimum": 1.0,
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "description": "Maximum time in seconds for each workflow execution",
            "title": "Execution Timeout"
          },
          "interval_seconds": {
            "anyOf": [
              {
                "minimum": 1.0,
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "description": "Alternative to cron - run every N seconds",
            "title": "Interval Seconds"
          },
          "name": {
            "description": "Human-readable name for the schedule (e.g., 'weekly-profiling'). Will be combined with agent_id to form the full schedule_id.",
            "maxLength": 64,
            "minLength": 1,
            "pattern": "^[a-z0-9][a-z0-9-]*[a-z0-9]$|^[a-z0-9]$",
            "title": "Schedule Name",
            "type": "string"
          },
          "paused": {
            "default": false,
            "description": "Whether to create the schedule in a paused state",
            "title": "Paused",
            "type": "boolean"
          },
          "start_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "When the schedule should start being active",
            "title": "Start At"
          },
          "task_queue": {
            "description": "Temporal task queue where the agent's worker is listening",
            "title": "Task Queue",
            "type": "string"
          },
          "workflow_name": {
            "description": "Name of the Temporal workflow to execute (e.g., 'sae-orchestrator')",
            "title": "Workflow Name",
            "type": "string"
          },
          "workflow_params": {
            "additionalProperties": true,
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "description": "Parameters to pass to the workflow",
            "title": "Workflow Parameters"
          }
        },
        "required": [
          "name",
          "workflow_name",
          "task_queue"
        ],
        "title": "CreateScheduleRequest",
        "type": "object"
      },
      "CreateSpanRequest": {
        "properties": {
          "data": {
            "additionalProperties": true,
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "items": {
                  "additionalProperties": true,
                  "type": "object"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "description": "Any additional metadata or context for the span",
            "title": "Additional data associated with the span"
          },
          "end_time": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "The time the span ended",
            "title": "The end time of the span"
          },
          "id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Unique identifier for the span. If not provided, an ID will be generated.",
            "title": "Unique Span ID"
          },
          "input": {
            "additionalProperties": true,
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "items": {
                  "additionalProperties": true,
                  "type": "object"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "description": "Input parameters or data for the operation",
            "title": "The input data for the span"
          },
          "name": {
            "description": "Name that describes what operation this span represents",
            "title": "The name of the span",
            "type": "string"
          },
          "output": {
            "additionalProperties": true,
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "items": {
                  "additionalProperties": true,
                  "type": "object"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "description": "Output data resulting from the operation",
            "title": "The output data from the span"
          },
          "parent_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "ID of the parent span if this is a child span in a trace",
            "title": "The parent span ID if this is a child span"
          },
          "start_time": {
            "description": "The time the span started",
            "format": "date-time",
            "title": "The start time of the span",
            "type": "string"
          },
          "task_id": {
            "description": "ID of the task this span is associated with, used for authorization",
            "title": "The task ID this span belongs to",
            "type": "string"
          },
          "trace_id": {
            "description": "Unique identifier for the trace this span belongs to",
            "title": "The trace ID for this span",
            "type": "string"
          }
        },
        "required": [
          "task_id",
          "trace_id",
          "name",
          "start_time"
        ],
        "title": "CreateSpanRequest",
        "type": "object"
      },
      "CreateStateRequest": {
        "properties": {
          "agent_id": {
            "title": "The unique id of the agent to send the state to",
            "type": "string"
          },
          "state": {
            "additionalProperties": true,
            "title": "The state to send to the task.",
            "type": "object"
          },
          "task_id": {
            "title": "The unique id of the task to send the state to",
            "type": "string"
          }
        },
        "required": [
          "task_id",
          "agent_id",
          "state"
        ],
        "title": "CreateStateRequest",
        "type": "object"
      },
      "CreateTaskEventRequest": {
        "description": "Request for POST /tasks/{task_id}/events\n\nContent accepts TextPart or DataPart only. Other message types (tool calls,\nreasoning, etc.) are agent-generated and sent via the /raw-events endpoint.",
        "properties": {
          "content": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/TextPart"
              },
              {
                "$ref": "#/components/schemas/DataPart"
              },
              {
                "type": "null"
              }
            ],
            "description": "Event content",
            "title": "Content"
          },
          "idempotency_key": {
            "anyOf": [
              {
                "maxLength": 256,
                "minLength": 1,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Optional idempotency key for retry-safe event delivery.",
            "title": "Idempotency Key"
          },
          "persist_message": {
            "default": true,
            "description": "Whether to also create a message record for this event. Defaults to True.",
            "title": "Persist Message",
            "type": "boolean"
          }
        },
        "title": "CreateTaskEventRequest",
        "type": "object"
      },
      "CreateTaskRequest": {
        "description": "Request for POST /tasks",
        "properties": {
          "agent_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Agent ID (provide this OR agent_name)",
            "title": "Agent Id"
          },
          "agent_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Agent name as 'namespace/name' (provide this OR agent_id)",
            "title": "Agent Name"
          },
          "branch": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Target branch for version routing",
            "title": "Branch"
          },
          "filesystem_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Existing filesystem ID",
            "title": "Filesystem Id"
          },
          "name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Task name",
            "title": "Name"
          },
          "params": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "description": "Task parameters",
            "title": "Params"
          },
          "project_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Project ID for new filesystem",
            "title": "Project Id"
          }
        },
        "title": "CreateTaskRequest",
        "type": "object"
      },
      "CrossEnvSecretResponse": {
        "description": "A secret key across all environments.",
        "properties": {
          "environments": {
            "description": "List of environments containing this key",
            "items": {
              "$ref": "#/components/schemas/EnvSecretInfo"
            },
            "title": "Environments",
            "type": "array"
          },
          "is_secret": {
            "description": "Whether this is a secret",
            "title": "Is Secret",
            "type": "boolean"
          },
          "key": {
            "description": "Secret key name",
            "title": "Key",
            "type": "string"
          },
          "value": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Value for non-secrets (is_secret=False) only. Always None for secrets.",
            "title": "Value"
          }
        },
        "required": [
          "key",
          "is_secret",
          "environments"
        ],
        "title": "CrossEnvSecretResponse",
        "type": "object"
      },
      "CrossEnvSecretsListResponse": {
        "description": "Cross-environment secrets view.",
        "properties": {
          "all_environments": {
            "description": "All environment names for the agent",
            "items": {
              "type": "string"
            },
            "title": "All Environments",
            "type": "array"
          },
          "variables": {
            "description": "All secret keys across environments",
            "items": {
              "$ref": "#/components/schemas/CrossEnvSecretResponse"
            },
            "title": "Variables",
            "type": "array"
          }
        },
        "required": [
          "variables",
          "all_environments"
        ],
        "title": "CrossEnvSecretsListResponse",
        "type": "object"
      },
      "DataPart": {
        "description": "Generic data part for unknown/passthrough content.",
        "properties": {
          "data": {
            "description": "Arbitrary data content",
            "title": "Data"
          },
          "type": {
            "const": "data",
            "default": "data",
            "description": "Part type discriminator",
            "title": "Type",
            "type": "string"
          }
        },
        "required": [
          "data"
        ],
        "title": "DataPart",
        "type": "object"
      },
      "DeleteEnvResponse": {
        "description": "Response after deleting an environment.",
        "properties": {
          "deleted": {
            "description": "Whether the environment was deleted",
            "title": "Deleted",
            "type": "boolean"
          },
          "name": {
            "description": "The name of the deleted environment",
            "title": "Name",
            "type": "string"
          }
        },
        "required": [
          "deleted",
          "name"
        ],
        "title": "DeleteEnvResponse",
        "type": "object"
      },
      "DeleteEnvVarResponse": {
        "description": "Response after deleting an environment variable.",
        "properties": {
          "deleted": {
            "description": "Whether the variable was deleted",
            "title": "Deleted",
            "type": "boolean"
          },
          "key": {
            "description": "The key that was deleted",
            "title": "Key",
            "type": "string"
          },
          "redeployed": {
            "default": false,
            "description": "Whether a redeploy was triggered",
            "title": "Redeployed",
            "type": "boolean"
          },
          "version_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "New version ID if redeployed",
            "title": "Version Id"
          }
        },
        "required": [
          "deleted",
          "key"
        ],
        "title": "DeleteEnvVarResponse",
        "type": "object"
      },
      "DeleteResponse": {
        "properties": {
          "id": {
            "title": "Id",
            "type": "string"
          },
          "message": {
            "title": "Message",
            "type": "string"
          }
        },
        "required": [
          "id",
          "message"
        ],
        "title": "DeleteResponse",
        "type": "object"
      },
      "DeployRequest": {
        "description": "Request model for deploying an agent.\n\nCalled by CLI after pushing the container image to the registry.",
        "properties": {
          "acp_type": {
            "$ref": "#/components/schemas/ACPType",
            "default": "async",
            "description": "ACP server type (sync or async)"
          },
          "agent_name": {
            "description": "Agent name in 'namespace_slug/agent_name' format (lowercase alphanumeric, hyphens, underscores)",
            "pattern": "^[a-z0-9][a-z0-9_-]*/[a-z0-9][a-z0-9_-]*$",
            "title": "Agent Name",
            "type": "string"
          },
          "are_tasks_sticky": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "If true, running tasks stay on their original version until completion during this deploy. If false or None, tasks are migrated to the new version immediately.",
            "title": "Are Tasks Sticky"
          },
          "author_email": {
            "description": "Git commit author email",
            "title": "Author Email",
            "type": "string"
          },
          "author_name": {
            "description": "Git commit author name",
            "title": "Author Name",
            "type": "string"
          },
          "branch": {
            "description": "Git branch name (e.g., 'main', 'feature/new-tool')",
            "title": "Branch",
            "type": "string"
          },
          "description": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Agent description (used when creating new agent)",
            "title": "Description"
          },
          "git_hash": {
            "description": "Git commit hash (short or full)",
            "maxLength": 40,
            "minLength": 7,
            "title": "Git Hash",
            "type": "string"
          },
          "git_message": {
            "anyOf": [
              {
                "maxLength": 500,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Git commit message (truncated if too long)",
            "title": "Git Message"
          },
          "image_url": {
            "description": "Full container image URL (e.g., 'us-east4-docker.pkg.dev/proj/repo/agent:hash')",
            "title": "Image Url",
            "type": "string"
          },
          "is_dirty": {
            "default": false,
            "description": "Whether the working directory had uncommitted changes at deploy time",
            "title": "Is Dirty",
            "type": "boolean"
          },
          "replicas": {
            "default": 1,
            "description": "Desired replica count (1-10)",
            "maximum": 10.0,
            "minimum": 1.0,
            "title": "Replicas",
            "type": "integer"
          },
          "resources": {
            "additionalProperties": true,
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "description": "Resource requests and limits (e.g., {'requests': {'cpu': '100m', 'memory': '256Mi'}, 'limits': {'cpu': '1000m', 'memory': '1Gi'}})",
            "title": "Resources"
          },
          "sdk_type": {
            "$ref": "#/components/schemas/SDKType",
            "default": "claude_agent_sdk",
            "description": "SDK type for agent runtime"
          },
          "source_filesystem_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Filesystem snapshot containing the deploy source for Builder reopenability",
            "title": "Source Filesystem Id"
          }
        },
        "required": [
          "agent_name",
          "branch",
          "git_hash",
          "image_url",
          "author_name",
          "author_email"
        ],
        "title": "DeployRequest",
        "type": "object"
      },
      "DeployResponse": {
        "description": "Immediate response from deploy request.\n\nCLI polls GET /branches/{branch_id} or GET /versions/{version_id} for status updates.",
        "properties": {
          "agent_id": {
            "description": "Agent ID (created or existing)",
            "title": "Agent Id",
            "type": "string"
          },
          "branch_id": {
            "description": "Branch ID for this git branch",
            "title": "Branch Id",
            "type": "string"
          },
          "message": {
            "description": "Human-readable status message",
            "title": "Message",
            "type": "string"
          },
          "tasks_migrated": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "description": "Number of tasks migrated from old version (if any)",
            "title": "Tasks Migrated"
          },
          "version_id": {
            "description": "New version ID",
            "title": "Version Id",
            "type": "string"
          },
          "version_status": {
            "$ref": "#/components/schemas/VersionStatus",
            "description": "Initial version status"
          }
        },
        "required": [
          "agent_id",
          "branch_id",
          "version_id",
          "version_status",
          "message"
        ],
        "title": "DeployResponse",
        "type": "object"
      },
      "DeployStreamCompleteEvent": {
        "description": "Stream is complete - deployment has reached a terminal state.\n\nSent by the SSE endpoint when the version status is terminal (ACTIVE, FAILED, etc.).",
        "properties": {
          "status": {
            "description": "Final version status (e.g., 'active', 'failed')",
            "title": "Status",
            "type": "string"
          },
          "type": {
            "const": "complete",
            "default": "complete",
            "title": "Type",
            "type": "string"
          }
        },
        "required": [
          "status"
        ],
        "title": "DeployStreamCompleteEvent",
        "type": "object"
      },
      "DeployStreamConnectedEvent": {
        "description": "Sent when SSE deploy stream connection is established.\n\nIndicates the client is now subscribed and will receive deployment progress events.",
        "properties": {
          "type": {
            "const": "connected",
            "default": "connected",
            "title": "Type",
            "type": "string"
          },
          "version_id": {
            "description": "Version ID this stream is subscribed to",
            "title": "Version Id",
            "type": "string"
          }
        },
        "required": [
          "version_id"
        ],
        "title": "DeployStreamConnectedEvent",
        "type": "object"
      },
      "DeployStreamErrorEvent": {
        "description": "Sent when an error occurs in the deploy stream.\n\nAfter this event, the stream may close.",
        "properties": {
          "message": {
            "description": "Error description",
            "title": "Message",
            "type": "string"
          },
          "type": {
            "const": "error",
            "default": "error",
            "title": "Type",
            "type": "string"
          }
        },
        "required": [
          "message"
        ],
        "title": "DeployStreamErrorEvent",
        "type": "object"
      },
      "DeployStreamEvent": {
        "description": "Union of all possible deploy stream SSE events.\n\nUse the 'type' field to discriminate between event types:\n- \"connected\": Stream connection established\n- \"queued\": Deployment queued\n- \"helm_started\": Helm deployment started\n- \"helm_waiting\": Waiting for pods to be ready\n- \"ready\": Deployment successful\n- \"failed\": Deployment failed\n- \"rolling_back\": Rolling back deployment\n- \"complete\": Stream complete, terminal state reached\n- \"error\": An error occurred in the stream",
        "discriminator": {
          "mapping": {
            "complete": "#/components/schemas/DeployStreamCompleteEvent",
            "connected": "#/components/schemas/DeployStreamConnectedEvent",
            "error": "#/components/schemas/DeployStreamErrorEvent",
            "failed": "#/components/schemas/DeployStreamFailedEvent",
            "helm_started": "#/components/schemas/DeployStreamHelmStartedEvent",
            "helm_waiting": "#/components/schemas/DeployStreamHelmWaitingEvent",
            "queued": "#/components/schemas/DeployStreamQueuedEvent",
            "ready": "#/components/schemas/DeployStreamReadyEvent",
            "rolling_back": "#/components/schemas/DeployStreamRollingBackEvent"
          },
          "propertyName": "type"
        },
        "oneOf": [
          {
            "$ref": "#/components/schemas/DeployStreamConnectedEvent"
          },
          {
            "$ref": "#/components/schemas/DeployStreamQueuedEvent"
          },
          {
            "$ref": "#/components/schemas/DeployStreamHelmStartedEvent"
          },
          {
            "$ref": "#/components/schemas/DeployStreamHelmWaitingEvent"
          },
          {
            "$ref": "#/components/schemas/DeployStreamReadyEvent"
          },
          {
            "$ref": "#/components/schemas/DeployStreamFailedEvent"
          },
          {
            "$ref": "#/components/schemas/DeployStreamRollingBackEvent"
          },
          {
            "$ref": "#/components/schemas/DeployStreamCompleteEvent"
          },
          {
            "$ref": "#/components/schemas/DeployStreamErrorEvent"
          }
        ],
        "title": "DeployStreamEvent"
      },
      "DeployStreamFailedEvent": {
        "description": "Deployment failed.",
        "properties": {
          "failure_reason": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Detailed failure reason",
            "title": "Failure Reason"
          },
          "message": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Error message",
            "title": "Message"
          },
          "timestamp": {
            "description": "ISO 8601 timestamp",
            "title": "Timestamp",
            "type": "string"
          },
          "type": {
            "const": "failed",
            "default": "failed",
            "title": "Type",
            "type": "string"
          },
          "version_id": {
            "description": "Version ID being deployed",
            "title": "Version Id",
            "type": "string"
          }
        },
        "required": [
          "version_id",
          "timestamp"
        ],
        "title": "DeployStreamFailedEvent",
        "type": "object"
      },
      "DeployStreamHelmStartedEvent": {
        "description": "Helm deployment has started.",
        "properties": {
          "message": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Optional status message",
            "title": "Message"
          },
          "timestamp": {
            "description": "ISO 8601 timestamp",
            "title": "Timestamp",
            "type": "string"
          },
          "type": {
            "const": "helm_started",
            "default": "helm_started",
            "title": "Type",
            "type": "string"
          },
          "version_id": {
            "description": "Version ID being deployed",
            "title": "Version Id",
            "type": "string"
          }
        },
        "required": [
          "version_id",
          "timestamp"
        ],
        "title": "DeployStreamHelmStartedEvent",
        "type": "object"
      },
      "DeployStreamHelmWaitingEvent": {
        "description": "Waiting for Helm deployment to complete (pods becoming ready).",
        "properties": {
          "message": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Optional status message",
            "title": "Message"
          },
          "timestamp": {
            "description": "ISO 8601 timestamp",
            "title": "Timestamp",
            "type": "string"
          },
          "type": {
            "const": "helm_waiting",
            "default": "helm_waiting",
            "title": "Type",
            "type": "string"
          },
          "version_id": {
            "description": "Version ID being deployed",
            "title": "Version Id",
            "type": "string"
          }
        },
        "required": [
          "version_id",
          "timestamp"
        ],
        "title": "DeployStreamHelmWaitingEvent",
        "type": "object"
      },
      "DeployStreamQueuedEvent": {
        "description": "Deployment has been queued for processing.",
        "properties": {
          "message": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Optional status message",
            "title": "Message"
          },
          "timestamp": {
            "description": "ISO 8601 timestamp",
            "title": "Timestamp",
            "type": "string"
          },
          "type": {
            "const": "queued",
            "default": "queued",
            "title": "Type",
            "type": "string"
          },
          "version_id": {
            "description": "Version ID being deployed",
            "title": "Version Id",
            "type": "string"
          }
        },
        "required": [
          "version_id",
          "timestamp"
        ],
        "title": "DeployStreamQueuedEvent",
        "type": "object"
      },
      "DeployStreamReadyEvent": {
        "description": "Deployment completed successfully.",
        "properties": {
          "message": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Optional status message",
            "title": "Message"
          },
          "timestamp": {
            "description": "ISO 8601 timestamp",
            "title": "Timestamp",
            "type": "string"
          },
          "type": {
            "const": "ready",
            "default": "ready",
            "title": "Type",
            "type": "string"
          },
          "version_id": {
            "description": "Version ID being deployed",
            "title": "Version Id",
            "type": "string"
          }
        },
        "required": [
          "version_id",
          "timestamp"
        ],
        "title": "DeployStreamReadyEvent",
        "type": "object"
      },
      "DeployStreamRollingBackEvent": {
        "description": "Deployment is being rolled back.",
        "properties": {
          "message": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Optional status message",
            "title": "Message"
          },
          "timestamp": {
            "description": "ISO 8601 timestamp",
            "title": "Timestamp",
            "type": "string"
          },
          "type": {
            "const": "rolling_back",
            "default": "rolling_back",
            "title": "Type",
            "type": "string"
          },
          "version_id": {
            "description": "Version ID being rolled back",
            "title": "Version Id",
            "type": "string"
          }
        },
        "required": [
          "version_id",
          "timestamp"
        ],
        "title": "DeployStreamRollingBackEvent",
        "type": "object"
      },
      "DeployedSecretKey": {
        "description": "A key from deployed secrets snapshot.",
        "properties": {
          "is_secret": {
            "default": true,
            "description": "Whether this is a secret. Derived from snapshot metadata.",
            "title": "Is Secret",
            "type": "boolean"
          },
          "key": {
            "description": "Secret key name",
            "title": "Key",
            "type": "string"
          }
        },
        "required": [
          "key"
        ],
        "title": "DeployedSecretKey",
        "type": "object"
      },
      "DeployedSecretsResponse": {
        "description": "Response for deployed secrets (from Version.secrets_snapshot).",
        "properties": {
          "deployed_at": {
            "description": "When this version was deployed",
            "format": "date-time",
            "title": "Deployed At",
            "type": "string"
          },
          "secrets": {
            "description": "List of secret keys (no values)",
            "items": {
              "$ref": "#/components/schemas/DeployedSecretKey"
            },
            "title": "Secrets",
            "type": "array"
          },
          "state": {
            "default": "deployed",
            "description": "Always 'deployed' for this response",
            "title": "State",
            "type": "string"
          },
          "version_id": {
            "description": "Version ID this snapshot came from",
            "title": "Version Id",
            "type": "string"
          }
        },
        "required": [
          "secrets",
          "version_id",
          "deployed_at"
        ],
        "title": "DeployedSecretsResponse",
        "type": "object"
      },
      "EnvListResponse": {
        "description": "Response for listing environments.",
        "properties": {
          "environments": {
            "description": "List of environments",
            "items": {
              "$ref": "#/components/schemas/EnvResponse"
            },
            "title": "Environments",
            "type": "array"
          },
          "total": {
            "description": "Total count",
            "title": "Total",
            "type": "integer"
          }
        },
        "required": [
          "environments",
          "total"
        ],
        "title": "EnvListResponse",
        "type": "object"
      },
      "EnvResponse": {
        "description": "Full environment details.",
        "properties": {
          "agent_id": {
            "description": "Parent agent ID",
            "title": "Agent Id",
            "type": "string"
          },
          "branch_rules": {
            "description": "Branch patterns for matching (e.g., ['main'], ['feature/*'])",
            "items": {
              "type": "string"
            },
            "title": "Branch Rules",
            "type": "array"
          },
          "created_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Creation timestamp",
            "title": "Created At"
          },
          "id": {
            "description": "Unique identifier",
            "title": "Id",
            "type": "string"
          },
          "is_prod": {
            "description": "Whether this is the production environment (protected)",
            "title": "Is Prod",
            "type": "boolean"
          },
          "name": {
            "description": "Environment name (e.g., 'production', 'staging')",
            "title": "Name",
            "type": "string"
          },
          "updated_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Last update timestamp",
            "title": "Updated At"
          }
        },
        "required": [
          "id",
          "agent_id",
          "name",
          "branch_rules",
          "is_prod"
        ],
        "title": "EnvResponse",
        "type": "object"
      },
      "EnvSecretInfo": {
        "description": "Secret presence in one environment.",
        "properties": {
          "env_name": {
            "description": "Environment name",
            "title": "Env Name",
            "type": "string"
          },
          "is_secret": {
            "description": "Whether this is a secret in this environment",
            "title": "Is Secret",
            "type": "boolean"
          },
          "updated_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Last update timestamp",
            "title": "Updated At"
          },
          "value": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Value for non-secrets (is_secret=False) only. Always None for secrets.",
            "title": "Value"
          }
        },
        "required": [
          "env_name",
          "is_secret"
        ],
        "title": "EnvSecretInfo",
        "type": "object"
      },
      "EnvVarListResponse": {
        "description": "Response for listing environment variables.",
        "properties": {
          "env_vars": {
            "description": "List of environment variables",
            "items": {
              "$ref": "#/components/schemas/EnvVarResponse"
            },
            "title": "Env Vars",
            "type": "array"
          },
          "state": {
            "default": "pending",
            "description": "Indicates this is pending state (vs deployed). Pending = what will be used on next deploy. Deployed = what's currently running (from Version.secrets_snapshot).",
            "title": "State",
            "type": "string"
          }
        },
        "required": [
          "env_vars"
        ],
        "title": "EnvVarListResponse",
        "type": "object"
      },
      "EnvVarResponse": {
        "description": "Response model for a single environment variable.",
        "properties": {
          "created_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Creation timestamp",
            "title": "Created At"
          },
          "env_id": {
            "description": "Environment ID",
            "title": "Env Id",
            "type": "string"
          },
          "id": {
            "description": "Unique identifier",
            "title": "Id",
            "type": "string"
          },
          "is_secret": {
            "description": "Whether value is write-only",
            "title": "Is Secret",
            "type": "boolean"
          },
          "key": {
            "description": "Variable key",
            "title": "Key",
            "type": "string"
          },
          "updated_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Last update timestamp",
            "title": "Updated At"
          },
          "value": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Decrypted value (only for non-secrets when requested)",
            "title": "Value"
          }
        },
        "required": [
          "id",
          "env_id",
          "key",
          "is_secret"
        ],
        "title": "EnvVarResponse",
        "type": "object"
      },
      "EnvVarValue": {
        "description": "Value with is_secret flag for setting environment variables.",
        "properties": {
          "is_secret": {
            "default": true,
            "description": "If true, value is write-only via API (cannot retrieve). If false, value can be read back via API.",
            "title": "Is Secret",
            "type": "boolean"
          },
          "value": {
            "description": "The plaintext value to encrypt and store",
            "title": "Value",
            "type": "string"
          }
        },
        "required": [
          "value"
        ],
        "title": "EnvVarValue",
        "type": "object"
      },
      "ErrorPart": {
        "description": "Error part for transformation failures.",
        "properties": {
          "error": {
            "description": "Error message",
            "title": "Error",
            "type": "string"
          },
          "rawContent": {
            "anyOf": [
              {},
              {
                "type": "null"
              }
            ],
            "description": "Original content that failed to transform",
            "title": "Rawcontent"
          },
          "type": {
            "const": "error",
            "default": "error",
            "description": "Part type discriminator",
            "title": "Type",
            "type": "string"
          }
        },
        "required": [
          "error"
        ],
        "title": "ErrorPart",
        "type": "object"
      },
      "Event": {
        "description": "Event returned from the events API.\n\nContent is TextPart or DataPart (human-readable content only).",
        "properties": {
          "agent_id": {
            "description": "The UUID of the agent that the event belongs to",
            "title": "Agent Id",
            "type": "string"
          },
          "content": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/TextPart"
              },
              {
                "$ref": "#/components/schemas/DataPart"
              },
              {
                "type": "null"
              }
            ],
            "description": "The content of the event (TextPart or DataPart)",
            "title": "Content"
          },
          "created_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "The timestamp of the event",
            "title": "Created At"
          },
          "id": {
            "description": "The UUID of the event",
            "title": "Id",
            "type": "string"
          },
          "sequence_id": {
            "description": "The sequence ID of the event",
            "title": "Sequence Id",
            "type": "integer"
          },
          "streamCapabilities": {
            "anyOf": [
              {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "description": "Server-advertised stream lifecycle capabilities for this event",
            "title": "Streamcapabilities"
          },
          "task_id": {
            "description": "The UUID of the task that the event belongs to",
            "title": "Task Id",
            "type": "string"
          }
        },
        "required": [
          "id",
          "sequence_id",
          "task_id",
          "agent_id"
        ],
        "title": "Event",
        "type": "object"
      },
      "FilePart": {
        "description": "File attachment part.",
        "properties": {
          "mediaType": {
            "description": "MIME type of the file",
            "title": "Mediatype",
            "type": "string"
          },
          "type": {
            "const": "file",
            "default": "file",
            "description": "Part type discriminator",
            "title": "Type",
            "type": "string"
          },
          "url": {
            "description": "URL to the file",
            "title": "Url",
            "type": "string"
          }
        },
        "required": [
          "url",
          "mediaType"
        ],
        "title": "FilePart",
        "type": "object"
      },
      "FileUploadWriteMode": {
        "description": "Single-file upload write semantics.",
        "enum": [
          "overwrite",
          "conditional"
        ],
        "title": "FileUploadWriteMode",
        "type": "string"
      },
      "FilesystemCreate": {
        "description": "Request model for creating a filesystem.\n\nFilesystems inherit permissions from their parent project.",
        "properties": {
          "name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Optional human-readable name for the filesystem (unique per namespace).",
            "title": "Name"
          },
          "project_id": {
            "description": "Project ID. Filesystem inherits permissions from the project.",
            "title": "Project Id",
            "type": "string"
          }
        },
        "required": [
          "project_id"
        ],
        "title": "FilesystemCreate",
        "type": "object"
      },
      "FilesystemFile": {
        "description": "File metadata - used for both input (sync-complete) and as base for response.",
        "properties": {
          "checksum": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "SHA256 checksum (None for directories).",
            "title": "Checksum"
          },
          "content": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "File contents (None for binary/large files).",
            "title": "Content"
          },
          "content_truncated": {
            "default": false,
            "description": "True if content was truncated due to size.",
            "title": "Content Truncated",
            "type": "boolean"
          },
          "is_binary": {
            "default": false,
            "description": "True if file is binary.",
            "title": "Is Binary",
            "type": "boolean"
          },
          "is_directory": {
            "default": false,
            "description": "Whether this entry is a directory.",
            "title": "Is Directory",
            "type": "boolean"
          },
          "mime_type": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "MIME type (None for directories).",
            "title": "Mime Type"
          },
          "modified_at": {
            "description": "File's last modification time.",
            "format": "date-time",
            "title": "Modified At",
            "type": "string"
          },
          "path": {
            "description": "Relative path within filesystem (e.g., 'src/index.ts').",
            "title": "Path",
            "type": "string"
          },
          "size_bytes": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "description": "File size in bytes (None for directories).",
            "title": "Size Bytes"
          }
        },
        "required": [
          "path",
          "modified_at"
        ],
        "title": "FilesystemFile",
        "type": "object"
      },
      "FilesystemFileResponse": {
        "description": "File metadata response - adds server-side fields.",
        "properties": {
          "checksum": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "SHA256 checksum (None for directories).",
            "title": "Checksum"
          },
          "content": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "File contents (None for binary/large files).",
            "title": "Content"
          },
          "content_truncated": {
            "default": false,
            "description": "True if content was truncated due to size.",
            "title": "Content Truncated",
            "type": "boolean"
          },
          "is_binary": {
            "default": false,
            "description": "True if file is binary.",
            "title": "Is Binary",
            "type": "boolean"
          },
          "is_directory": {
            "default": false,
            "description": "Whether this entry is a directory.",
            "title": "Is Directory",
            "type": "boolean"
          },
          "mime_type": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "MIME type (None for directories).",
            "title": "Mime Type"
          },
          "modified_at": {
            "description": "File's last modification time.",
            "format": "date-time",
            "title": "Modified At",
            "type": "string"
          },
          "path": {
            "description": "Relative path within filesystem (e.g., 'src/index.ts').",
            "title": "Path",
            "type": "string"
          },
          "size_bytes": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "description": "File size in bytes (None for directories).",
            "title": "Size Bytes"
          },
          "synced_at": {
            "description": "When this entry was last synced.",
            "format": "date-time",
            "title": "Synced At",
            "type": "string"
          }
        },
        "required": [
          "path",
          "modified_at",
          "synced_at"
        ],
        "title": "FilesystemFileResponse",
        "type": "object"
      },
      "FilesystemResponse": {
        "description": "Response model for filesystem operations.",
        "properties": {
          "archive_checksum": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "SHA256 checksum of the archive for detecting changes.",
            "title": "Archive Checksum"
          },
          "archive_path": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "GCS path for the filesystem's archive.",
            "title": "Archive Path"
          },
          "archive_size_bytes": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "description": "Size of the archive in bytes after last sync.",
            "title": "Archive Size Bytes"
          },
          "created_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "The timestamp when the filesystem was created.",
            "title": "Created At"
          },
          "id": {
            "description": "The unique identifier of the filesystem.",
            "title": "Id",
            "type": "string"
          },
          "last_synced_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Timestamp of the last successful sync operation.",
            "title": "Last Synced At"
          },
          "name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Optional human-readable name (unique per namespace).",
            "title": "Name"
          },
          "namespace_id": {
            "description": "The namespace this filesystem belongs to.",
            "title": "Namespace Id",
            "type": "string"
          },
          "project_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "The project this filesystem belongs to (optional).",
            "title": "Project Id"
          },
          "status": {
            "$ref": "#/components/schemas/FilesystemStatus",
            "description": "The current status of the filesystem."
          },
          "updated_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "The timestamp when the filesystem was last updated.",
            "title": "Updated At"
          }
        },
        "required": [
          "id",
          "namespace_id",
          "status"
        ],
        "title": "FilesystemResponse",
        "type": "object"
      },
      "FilesystemStatus": {
        "description": "Filesystem lifecycle status states.",
        "enum": [
          "CREATING",
          "READY",
          "SYNCING_UP",
          "SYNCING_DOWN",
          "FAILED"
        ],
        "title": "FilesystemStatus",
        "type": "string"
      },
      "FinishPart": {
        "description": "Marks the end of the entire streaming session.",
        "properties": {
          "finishReason": {
            "$ref": "#/components/schemas/FinishReason",
            "description": "Reason session finished"
          },
          "metadata": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/StreamMetadata"
              },
              {
                "type": "null"
              }
            ],
            "description": "Extended metadata including cost and duration"
          },
          "totalUsage": {
            "$ref": "#/components/schemas/StreamUsage",
            "description": "Total token usage"
          },
          "type": {
            "const": "finish",
            "default": "finish",
            "title": "Type",
            "type": "string"
          }
        },
        "required": [
          "finishReason",
          "totalUsage"
        ],
        "title": "FinishPart",
        "type": "object"
      },
      "FinishReason": {
        "description": "Reason for stream completion.",
        "enum": [
          "stop",
          "tool-calls",
          "length",
          "content-filter",
          "error",
          "other"
        ],
        "title": "FinishReason",
        "type": "string"
      },
      "FinishStepPart": {
        "description": "Marks the end of a step (API call).",
        "properties": {
          "finishReason": {
            "$ref": "#/components/schemas/FinishReason",
            "description": "Reason step finished"
          },
          "metadata": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/StreamMetadata"
              },
              {
                "type": "null"
              }
            ],
            "description": "Metadata including parentToolUseId for subagents"
          },
          "type": {
            "const": "finish-step",
            "default": "finish-step",
            "title": "Type",
            "type": "string"
          },
          "usage": {
            "$ref": "#/components/schemas/StreamUsage",
            "description": "Token usage for this step"
          }
        },
        "required": [
          "finishReason",
          "usage"
        ],
        "title": "FinishStepPart",
        "type": "object"
      },
      "HTTPValidationError": {
        "properties": {
          "detail": {
            "items": {
              "$ref": "#/components/schemas/ValidationError"
            },
            "title": "Detail",
            "type": "array"
          }
        },
        "title": "HTTPValidationError",
        "type": "object"
      },
      "HandlerCompletePart": {
        "description": "Marks completion of event/send handler lifecycle for a specific event.",
        "properties": {
          "durationMs": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "description": "Handler runtime in milliseconds",
            "title": "Durationms"
          },
          "error": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Handler error text when execution failed",
            "title": "Error"
          },
          "eventId": {
            "description": "Event ID correlated to this handler completion",
            "title": "Eventid",
            "type": "string"
          },
          "success": {
            "description": "Whether handler execution succeeded",
            "title": "Success",
            "type": "boolean"
          },
          "taskId": {
            "description": "Task ID whose handler lifecycle completed",
            "title": "Taskid",
            "type": "string"
          },
          "type": {
            "const": "handler-complete",
            "default": "handler-complete",
            "title": "Type",
            "type": "string"
          }
        },
        "required": [
          "eventId",
          "taskId",
          "success"
        ],
        "title": "HandlerCompletePart",
        "type": "object"
      },
      "HandlerEndRequest": {
        "properties": {
          "duration_ms": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Duration Ms"
          },
          "error": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Error"
          },
          "event_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Event Id"
          },
          "pod_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Pod Id"
          },
          "success": {
            "default": true,
            "title": "Success",
            "type": "boolean"
          }
        },
        "title": "HandlerEndRequest",
        "type": "object"
      },
      "HandlerEndResponse": {
        "properties": {
          "handler_status": {
            "title": "Handler Status",
            "type": "string"
          },
          "task_status": {
            "title": "Task Status",
            "type": "string"
          }
        },
        "required": [
          "handler_status",
          "task_status"
        ],
        "title": "HandlerEndResponse",
        "type": "object"
      },
      "ListFilesResponse": {
        "description": "Response model for listing files in a filesystem.",
        "properties": {
          "files": {
            "description": "List of file entries.",
            "items": {
              "$ref": "#/components/schemas/FilesystemFileResponse"
            },
            "title": "Files",
            "type": "array"
          },
          "filesystem_id": {
            "description": "The filesystem ID.",
            "title": "Filesystem Id",
            "type": "string"
          },
          "synced_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "When the manifest was last synced.",
            "title": "Synced At"
          },
          "total_count": {
            "description": "Total number of matching files.",
            "title": "Total Count",
            "type": "integer"
          }
        },
        "required": [
          "filesystem_id",
          "total_count",
          "files"
        ],
        "title": "ListFilesResponse",
        "type": "object"
      },
      "ListMessagesV2Response": {
        "description": "Response for list messages v2 endpoint.",
        "properties": {
          "data": {
            "description": "List of UIMessages",
            "items": {
              "$ref": "#/components/schemas/UIMessage"
            },
            "title": "Data",
            "type": "array"
          },
          "hasMore": {
            "default": false,
            "description": "Whether there are more messages to fetch",
            "title": "Hasmore",
            "type": "boolean"
          },
          "nextCursor": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Cursor for fetching the next page",
            "title": "Nextcursor"
          }
        },
        "required": [
          "data"
        ],
        "title": "ListMessagesV2Response",
        "type": "object"
      },
      "LogLevel": {
        "description": "Log level for entries.",
        "enum": [
          "DEBUG",
          "INFO",
          "WARNING",
          "ERROR",
          "CRITICAL"
        ],
        "title": "LogLevel",
        "type": "string"
      },
      "LogListResponse": {
        "description": "Response from logs list endpoint.",
        "properties": {
          "has_more": {
            "title": "Whether there are more logs available beyond the current page",
            "type": "boolean"
          },
          "logs": {
            "items": {
              "$ref": "#/components/schemas/LogQueryEntry"
            },
            "title": "List of log entries",
            "type": "array"
          },
          "total": {
            "title": "Total number of logs matching the query",
            "type": "integer"
          }
        },
        "required": [
          "logs",
          "total",
          "has_more"
        ],
        "title": "LogListResponse",
        "type": "object"
      },
      "LogQueryEntry": {
        "description": "A log entry returned from queries.",
        "properties": {
          "agent_id": {
            "title": "ID of the agent that generated this log",
            "type": "string"
          },
          "environment": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Deployment environment (e.g., production, staging)"
          },
          "level": {
            "$ref": "#/components/schemas/LogLevel",
            "title": "Log level (DEBUG, INFO, WARNING, ERROR, CRITICAL)"
          },
          "log_id": {
            "title": "Unique log ID (ULID) for cursor-based pagination",
            "type": "string"
          },
          "logger": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Logger/module name that produced this log"
          },
          "message": {
            "title": "The log message content",
            "type": "string"
          },
          "method": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "RPC method that was called"
          },
          "source": {
            "$ref": "#/components/schemas/LogSource",
            "title": "Source of the log entry (stdout, stderr, or server)"
          },
          "span_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "OTEL span ID for distributed tracing correlation"
          },
          "task_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "ID of the task that generated this log"
          },
          "timestamp": {
            "title": "ISO 8601 timestamp when the log was generated",
            "type": "string"
          },
          "trace_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "OTEL trace ID for distributed tracing correlation"
          },
          "version": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Agent version from deployment"
          }
        },
        "required": [
          "log_id",
          "timestamp",
          "agent_id",
          "source",
          "level",
          "message"
        ],
        "title": "LogQueryEntry",
        "type": "object"
      },
      "LogSource": {
        "description": "Source of the log entry.",
        "enum": [
          "stdout",
          "stderr",
          "server"
        ],
        "title": "LogSource",
        "type": "string"
      },
      "LogStreamConnectedEvent": {
        "description": "Sent when SSE log stream connection is established.\n\nIndicates the client is now subscribed and will receive new logs.\nOnly logs generated AFTER this event will be streamed (tail -f behavior).",
        "properties": {
          "agent_id": {
            "description": "Agent ID this stream is subscribed to",
            "title": "Agent Id",
            "type": "string"
          },
          "type": {
            "const": "connected",
            "default": "connected",
            "title": "Type",
            "type": "string"
          }
        },
        "required": [
          "agent_id"
        ],
        "title": "LogStreamConnectedEvent",
        "type": "object"
      },
      "LogStreamErrorEvent": {
        "description": "Sent when an error occurs in the log stream.\n\nAfter this event, the stream may close or attempt recovery.",
        "properties": {
          "message": {
            "description": "Error description",
            "title": "Message",
            "type": "string"
          },
          "type": {
            "const": "error",
            "default": "error",
            "title": "Type",
            "type": "string"
          }
        },
        "required": [
          "message"
        ],
        "title": "LogStreamErrorEvent",
        "type": "object"
      },
      "LogStreamEvent": {
        "description": "Union of all possible log stream SSE events.\n\nUse the 'type' field to discriminate between event types:\n- \"connected\": Stream connection established\n- \"log\": A log entry\n- \"error\": An error occurred in the stream",
        "discriminator": {
          "mapping": {
            "connected": "#/components/schemas/LogStreamConnectedEvent",
            "error": "#/components/schemas/LogStreamErrorEvent",
            "log": "#/components/schemas/LogStreamLogEvent"
          },
          "propertyName": "type"
        },
        "oneOf": [
          {
            "$ref": "#/components/schemas/LogStreamConnectedEvent"
          },
          {
            "$ref": "#/components/schemas/LogStreamLogEvent"
          },
          {
            "$ref": "#/components/schemas/LogStreamErrorEvent"
          }
        ],
        "title": "LogStreamEvent"
      },
      "LogStreamLogEvent": {
        "description": "A log entry in the SSE stream.\n\nWraps LogQueryEntry fields with a type discriminator for SDK parsing.",
        "properties": {
          "agent_id": {
            "title": "Agent Id",
            "type": "string"
          },
          "branch_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Branch Id"
          },
          "environment": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Environment"
          },
          "level": {
            "title": "Level",
            "type": "string"
          },
          "log_id": {
            "title": "Log Id",
            "type": "string"
          },
          "logger": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Logger"
          },
          "message": {
            "title": "Message",
            "type": "string"
          },
          "source": {
            "title": "Source",
            "type": "string"
          },
          "task_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Task Id"
          },
          "timestamp": {
            "title": "Timestamp",
            "type": "string"
          },
          "type": {
            "const": "log",
            "default": "log",
            "title": "Type",
            "type": "string"
          },
          "version": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Version"
          }
        },
        "required": [
          "log_id",
          "timestamp",
          "agent_id",
          "level",
          "source",
          "message"
        ],
        "title": "LogStreamLogEvent",
        "type": "object"
      },
      "MetricsIngestionRequest": {
        "description": "OTLP metrics data in JSON format.\n\nSee: https://opentelemetry.io/docs/specs/otlp/#otlphttp",
        "properties": {
          "resourceMetrics": {
            "description": "Array of ResourceMetrics as per OTLP JSON format",
            "items": {
              "additionalProperties": true,
              "type": "object"
            },
            "maxItems": 1000,
            "title": "Resourcemetrics",
            "type": "array"
          }
        },
        "required": [
          "resourceMetrics"
        ],
        "title": "MetricsIngestionRequest",
        "type": "object"
      },
      "MetricsIngestionResponse": {
        "description": "Response from metrics ingestion.",
        "properties": {
          "metrics_count": {
            "description": "Number of metrics ingested",
            "title": "Metrics Count",
            "type": "integer"
          },
          "status": {
            "default": "accepted",
            "title": "Status",
            "type": "string"
          }
        },
        "required": [
          "metrics_count"
        ],
        "title": "MetricsIngestionResponse",
        "type": "object"
      },
      "MigrateTasksRequest": {
        "description": "Request model for migrating tasks between versions.",
        "properties": {
          "from_version_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Migrate ALL RUNNING tasks from this version",
            "title": "From Version Id"
          },
          "task_ids": {
            "anyOf": [
              {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "description": "OR migrate specific task IDs",
            "title": "Task Ids"
          },
          "to_latest": {
            "default": false,
            "description": "OR migrate to ACTIVE/DEPLOYING version on branch",
            "title": "To Latest",
            "type": "boolean"
          },
          "to_version_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Explicit target version ID",
            "title": "To Version Id"
          }
        },
        "title": "MigrateTasksRequest",
        "type": "object"
      },
      "MigrateTasksResponse": {
        "description": "Response model for task migration operation.",
        "properties": {
          "branch_id": {
            "description": "Branch both versions belong to",
            "title": "Branch Id",
            "type": "string"
          },
          "from_version_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Source version (if bulk mode)",
            "title": "From Version Id"
          },
          "tasks": {
            "description": "Migrated tasks",
            "items": {
              "$ref": "#/components/schemas/TaskResponse"
            },
            "title": "Tasks",
            "type": "array"
          },
          "to_version": {
            "$ref": "#/components/schemas/VersionResponse",
            "description": "Target version details"
          }
        },
        "required": [
          "to_version",
          "branch_id",
          "tasks"
        ],
        "title": "MigrateTasksResponse",
        "type": "object"
      },
      "Namespace": {
        "description": "Response model for namespace.",
        "properties": {
          "artifact_registry": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Artifact Registry repository name.",
            "title": "Artifact Registry"
          },
          "created_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "When the namespace was created.",
            "title": "Created At"
          },
          "created_by": {
            "description": "member_id of the creator.",
            "title": "Created By",
            "type": "string"
          },
          "error": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Error message if provisioning failed.",
            "title": "Error"
          },
          "error_step": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Which provisioning step failed (e.g., 'create_gcs_bucket').",
            "title": "Error Step"
          },
          "gcp_sa_email": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "GCP service account email.",
            "title": "Gcp Sa Email"
          },
          "gcs_bucket": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "GCS bucket name.",
            "title": "Gcs Bucket"
          },
          "id": {
            "description": "The unique identifier of the namespace.",
            "title": "Id",
            "type": "string"
          },
          "k8s_namespace": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "K8s namespace name.",
            "title": "K8S Namespace"
          },
          "name": {
            "description": "Human-readable name for the namespace.",
            "title": "Name",
            "type": "string"
          },
          "owner_org_id": {
            "description": "WorkOS organization ID that owns this namespace.",
            "title": "Owner Org Id",
            "type": "string"
          },
          "registry_sa_email": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Registry service account email for token generation.",
            "title": "Registry Sa Email"
          },
          "slug": {
            "description": "URL-friendly unique identifier.",
            "title": "Slug",
            "type": "string"
          },
          "status": {
            "$ref": "#/components/schemas/NamespaceStatus",
            "default": "READY",
            "description": "Namespace status: pending, ready, or failed."
          }
        },
        "required": [
          "id",
          "slug",
          "name",
          "owner_org_id",
          "created_by"
        ],
        "title": "Namespace",
        "type": "object"
      },
      "NamespaceStatus": {
        "description": "Status of namespace infrastructure provisioning.",
        "enum": [
          "PENDING",
          "READY",
          "FAILED"
        ],
        "title": "NamespaceStatus",
        "type": "string"
      },
      "OAuthInitiateResponse": {
        "description": "Response for OAuth initiation.",
        "properties": {
          "authorization_url": {
            "description": "URL to redirect user for authentication",
            "title": "Authorization Url",
            "type": "string"
          },
          "state": {
            "description": "State parameter for CSRF protection",
            "title": "State",
            "type": "string"
          }
        },
        "required": [
          "authorization_url",
          "state"
        ],
        "title": "OAuthInitiateResponse",
        "type": "object"
      },
      "OAuthTokenResponse": {
        "description": "Response for token exchange.",
        "properties": {
          "access_token": {
            "description": "WorkOS access token",
            "title": "Access Token",
            "type": "string"
          },
          "expires_in": {
            "description": "Token expiration in seconds",
            "title": "Expires In",
            "type": "integer"
          },
          "refresh_token": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Refresh token (if available)",
            "title": "Refresh Token"
          },
          "token_type": {
            "default": "Bearer",
            "description": "Token type",
            "title": "Token Type",
            "type": "string"
          }
        },
        "required": [
          "access_token",
          "expires_in"
        ],
        "title": "OAuthTokenResponse",
        "type": "object"
      },
      "OTLPAttribute": {
        "description": "OTLP key-value attribute.",
        "properties": {
          "key": {
            "maxLength": 256,
            "title": "Key",
            "type": "string"
          },
          "value": {
            "$ref": "#/components/schemas/OTLPAttributeValue"
          }
        },
        "required": [
          "key",
          "value"
        ],
        "title": "OTLPAttribute",
        "type": "object"
      },
      "OTLPAttributeValue": {
        "description": "OTLP attribute value supporting multiple types.\n\nPer OTLP JSON spec, intValue is transmitted as a string to avoid JSON number\nprecision issues with int64 values. We validate that the string represents\na valid integer and provide a helper property to get the actual int value.\n\nString values are limited to MAX_ATTRIBUTE_VALUE_LENGTH (4KB) to prevent\nmemory exhaustion and ClickHouse insert failures.",
        "properties": {
          "arrayValue": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Arrayvalue"
          },
          "boolValue": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Boolvalue"
          },
          "bytesValue": {
            "anyOf": [
              {
                "maxLength": 4096,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Bytesvalue"
          },
          "doubleValue": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Doublevalue"
          },
          "intValue": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Intvalue"
          },
          "stringValue": {
            "anyOf": [
              {
                "maxLength": 4096,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Stringvalue"
          }
        },
        "title": "OTLPAttributeValue",
        "type": "object"
      },
      "OTLPBodyValue": {
        "description": "OTLP body value for log record messages.\n\nUnlike OTLPAttributeValue, this class does NOT have max_length constraints\non stringValue. This allows the OTLPLogRecord.validate_body_size validator\nto handle truncation for messages between 4KB and 64KB, rather than having\nPydantic reject them outright due to the 4KB attribute limit.\n\nMessages exceeding MAX_MESSAGE_LENGTH (64KB) are truncated with a marker.",
        "properties": {
          "arrayValue": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Arrayvalue"
          },
          "boolValue": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Boolvalue"
          },
          "bytesValue": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Bytesvalue"
          },
          "doubleValue": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Doublevalue"
          },
          "intValue": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Intvalue"
          },
          "stringValue": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Stringvalue"
          }
        },
        "title": "OTLPBodyValue",
        "type": "object"
      },
      "OTLPLogIngestionRequest": {
        "description": "OTLP log data in JSON format.",
        "properties": {
          "resourceLogs": {
            "description": "Array of ResourceLogs per OTLP spec",
            "items": {
              "$ref": "#/components/schemas/OTLPResourceLogs"
            },
            "maxItems": 100,
            "title": "Resourcelogs",
            "type": "array"
          }
        },
        "required": [
          "resourceLogs"
        ],
        "title": "OTLPLogIngestionRequest",
        "type": "object"
      },
      "OTLPLogIngestionResponse": {
        "description": "Response from OTLP log ingestion endpoint.",
        "properties": {
          "logs_count": {
            "description": "Number of log records ingested",
            "title": "Logs Count",
            "type": "integer"
          },
          "status": {
            "default": "accepted",
            "title": "Status",
            "type": "string"
          }
        },
        "required": [
          "logs_count"
        ],
        "title": "OTLPLogIngestionResponse",
        "type": "object"
      },
      "OTLPLogRecord": {
        "description": "OTLP log record.\n\nThe body field (message content) is limited to MAX_MESSAGE_LENGTH (64KB).\nMessages exceeding this limit are truncated with a \"[TRUNCATED]\" indicator.\nAttributes are limited to MAX_ATTRIBUTES_PER_LOG (32) per log record.",
        "properties": {
          "attributes": {
            "default": [],
            "items": {
              "$ref": "#/components/schemas/OTLPAttribute"
            },
            "maxItems": 32,
            "title": "Attributes",
            "type": "array"
          },
          "body": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/OTLPBodyValue"
              },
              {
                "type": "null"
              }
            ]
          },
          "severityNumber": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Severitynumber"
          },
          "severityText": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Severitytext"
          },
          "spanId": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Spanid"
          },
          "timeUnixNano": {
            "default": "",
            "title": "Timeunixnano",
            "type": "string"
          },
          "traceId": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Traceid"
          }
        },
        "title": "OTLPLogRecord",
        "type": "object"
      },
      "OTLPResource": {
        "description": "OTLP resource with attributes.",
        "properties": {
          "attributes": {
            "default": [],
            "items": {
              "$ref": "#/components/schemas/OTLPAttribute"
            },
            "maxItems": 32,
            "title": "Attributes",
            "type": "array"
          }
        },
        "title": "OTLPResource",
        "type": "object"
      },
      "OTLPResourceLogs": {
        "description": "OTLP resource logs container.",
        "properties": {
          "resource": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/OTLPResource"
              },
              {
                "type": "null"
              }
            ]
          },
          "scopeLogs": {
            "default": [],
            "items": {
              "$ref": "#/components/schemas/OTLPScopeLogs"
            },
            "maxItems": 100,
            "title": "Scopelogs",
            "type": "array"
          }
        },
        "title": "OTLPResourceLogs",
        "type": "object"
      },
      "OTLPScope": {
        "description": "OTLP instrumentation scope.",
        "properties": {
          "name": {
            "default": "",
            "title": "Name",
            "type": "string"
          },
          "version": {
            "default": "",
            "title": "Version",
            "type": "string"
          }
        },
        "title": "OTLPScope",
        "type": "object"
      },
      "OTLPScopeLogs": {
        "description": "OTLP scope logs containing log records.",
        "properties": {
          "logRecords": {
            "default": [],
            "items": {
              "$ref": "#/components/schemas/OTLPLogRecord"
            },
            "maxItems": 1000,
            "title": "Logrecords",
            "type": "array"
          },
          "scope": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/OTLPScope"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "title": "OTLPScopeLogs",
        "type": "object"
      },
      "OrganizationInvitationResponse": {
        "description": "Response model for organization invitation details.",
        "properties": {
          "accepted_user_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Accepted WorkOS user ID",
            "title": "Accepted User Id"
          },
          "created_at": {
            "description": "Invitation created timestamp",
            "title": "Created At",
            "type": "string"
          },
          "email": {
            "description": "Invitee email",
            "title": "Email",
            "type": "string"
          },
          "expires_at": {
            "description": "Invitation expiration timestamp",
            "title": "Expires At",
            "type": "string"
          },
          "id": {
            "description": "The WorkOS invitation ID",
            "title": "Id",
            "type": "string"
          },
          "inviter_user_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Inviter WorkOS user ID",
            "title": "Inviter User Id"
          },
          "role_slug": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Invitation role slug",
            "title": "Role Slug"
          },
          "state": {
            "description": "Invitation state",
            "title": "State",
            "type": "string"
          },
          "updated_at": {
            "description": "Invitation updated timestamp",
            "title": "Updated At",
            "type": "string"
          }
        },
        "required": [
          "id",
          "email",
          "state",
          "expires_at",
          "created_at",
          "updated_at"
        ],
        "title": "OrganizationInvitationResponse",
        "type": "object"
      },
      "OrganizationMemberResponse": {
        "description": "Response model for organization member details.",
        "properties": {
          "created_at": {
            "description": "Membership created timestamp",
            "title": "Created At",
            "type": "string"
          },
          "email": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "User email",
            "title": "Email"
          },
          "membership_id": {
            "description": "The WorkOS organization membership ID",
            "title": "Membership Id",
            "type": "string"
          },
          "name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "User display name",
            "title": "Name"
          },
          "role_slug": {
            "description": "Membership role slug",
            "title": "Role Slug",
            "type": "string"
          },
          "status": {
            "description": "Membership status",
            "title": "Status",
            "type": "string"
          },
          "updated_at": {
            "description": "Membership updated timestamp",
            "title": "Updated At",
            "type": "string"
          },
          "user_id": {
            "description": "The WorkOS user ID",
            "title": "User Id",
            "type": "string"
          }
        },
        "required": [
          "membership_id",
          "user_id",
          "role_slug",
          "status",
          "created_at",
          "updated_at"
        ],
        "title": "OrganizationMemberResponse",
        "type": "object"
      },
      "OrganizationResponse": {
        "description": "Response model for organization info.",
        "properties": {
          "id": {
            "description": "The WorkOS organization ID",
            "title": "Id",
            "type": "string"
          },
          "name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Organization display name",
            "title": "Name"
          },
          "slug": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Organization slug (URL-friendly)",
            "title": "Slug"
          }
        },
        "required": [
          "id"
        ],
        "title": "OrganizationResponse",
        "type": "object"
      },
      "PauseScheduleRequest": {
        "description": "Request model for pausing a schedule",
        "properties": {
          "note": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Optional note explaining why the schedule was paused",
            "title": "Note"
          }
        },
        "title": "PauseScheduleRequest",
        "type": "object"
      },
      "PresignedUrlRequest": {
        "description": "Request model for presigned URL generation.",
        "properties": {
          "expiration_seconds": {
            "default": 3600,
            "description": "URL expiration time in seconds (default 1 hour, max 7 days).",
            "maximum": 604800.0,
            "minimum": 60.0,
            "title": "Expiration Seconds",
            "type": "integer"
          }
        },
        "title": "PresignedUrlRequest",
        "type": "object"
      },
      "PresignedUrlResponse": {
        "description": "Response model for presigned URL operations.",
        "properties": {
          "content_type": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Content-Type header to use (required for PUT uploads).",
            "title": "Content Type"
          },
          "expires_at": {
            "description": "When the presigned URL expires.",
            "format": "date-time",
            "title": "Expires At",
            "type": "string"
          },
          "instructions": {
            "description": "Instructions for using the presigned URL.",
            "title": "Instructions",
            "type": "string"
          },
          "method": {
            "description": "HTTP method to use: 'PUT' for upload, 'GET' for download.",
            "title": "Method",
            "type": "string"
          },
          "url": {
            "description": "The presigned URL for direct GCS upload/download.",
            "title": "Url",
            "type": "string"
          }
        },
        "required": [
          "url",
          "expires_at",
          "method",
          "instructions"
        ],
        "title": "PresignedUrlResponse",
        "type": "object"
      },
      "PrincipalContextEntity": {
        "description": "Principal context representing an authenticated user or service user.\n\nThe member_id is:\n- For human users: WorkOS user ID (e.g., \"user_xyz\")\n- For service users: Service user ID (e.g., \"svc_abc123\")\n\nThis is the primary identifier used for authorization checks in OpenFGA.",
        "properties": {
          "api_key_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Api Key Id"
          },
          "email": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Email"
          },
          "is_service_user": {
            "default": false,
            "title": "Is Service User",
            "type": "boolean"
          },
          "member_id": {
            "title": "Member Id",
            "type": "string"
          },
          "name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Name"
          },
          "org_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Org Id"
          },
          "role": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Role"
          }
        },
        "required": [
          "member_id"
        ],
        "title": "PrincipalContextEntity",
        "type": "object"
      },
      "Project": {
        "description": "Response model for project.",
        "properties": {
          "created_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "When the project was created.",
            "title": "Created At"
          },
          "created_by": {
            "description": "member_id of the creator.",
            "title": "Created By",
            "type": "string"
          },
          "description": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Optional project description.",
            "title": "Description"
          },
          "id": {
            "description": "The unique identifier of the project.",
            "title": "Id",
            "type": "string"
          },
          "name": {
            "description": "Project name.",
            "title": "Name",
            "type": "string"
          },
          "namespace_id": {
            "description": "The namespace this project belongs to.",
            "title": "Namespace Id",
            "type": "string"
          }
        },
        "required": [
          "id",
          "namespace_id",
          "name",
          "created_by"
        ],
        "title": "Project",
        "type": "object"
      },
      "ProjectCollaboratorResponse": {
        "description": "Response model for project collaborator.",
        "properties": {
          "member_id": {
            "description": "The WorkOS user ID of the collaborator.",
            "title": "Member Id",
            "type": "string"
          },
          "role": {
            "description": "Collaborator role.",
            "enum": [
              "discoverer",
              "viewer",
              "editor",
              "owner"
            ],
            "title": "Role",
            "type": "string"
          }
        },
        "required": [
          "member_id",
          "role"
        ],
        "title": "ProjectCollaboratorResponse",
        "type": "object"
      },
      "ProjectCollaboratorsResponse": {
        "description": "Response model for project collaborators list.",
        "properties": {
          "can_manage": {
            "description": "Whether the current user can manage collaborators.",
            "title": "Can Manage",
            "type": "boolean"
          },
          "collaborators": {
            "description": "Project collaborators with explicit direct roles.",
            "items": {
              "$ref": "#/components/schemas/ProjectCollaboratorResponse"
            },
            "title": "Collaborators",
            "type": "array"
          }
        },
        "required": [
          "can_manage"
        ],
        "title": "ProjectCollaboratorsResponse",
        "type": "object"
      },
      "ProjectListItem": {
        "description": "Minimal project shape for discovery/listing.\n\nThe /projects list endpoint is authorized via `discover` and must not leak\nread-level fields (e.g. description).",
        "properties": {
          "id": {
            "description": "The unique identifier of the project.",
            "title": "Id",
            "type": "string"
          },
          "name": {
            "description": "Project name.",
            "title": "Name",
            "type": "string"
          },
          "namespace_id": {
            "description": "The namespace this project belongs to.",
            "title": "Namespace Id",
            "type": "string"
          }
        },
        "required": [
          "id",
          "namespace_id",
          "name"
        ],
        "title": "ProjectListItem",
        "type": "object"
      },
      "PublishRawEventResponse": {
        "description": "Response after publishing a raw event.",
        "properties": {
          "published_count": {
            "description": "Number of stream parts published to Redis",
            "title": "Published Count",
            "type": "integer"
          },
          "stored": {
            "description": "Whether the message was persisted to storage",
            "title": "Stored",
            "type": "boolean"
          }
        },
        "required": [
          "published_count",
          "stored"
        ],
        "title": "PublishRawEventResponse",
        "type": "object"
      },
      "RawEventPayload": {
        "description": "Request payload for publishing a raw SDK event.",
        "properties": {
          "idempotency_key": {
            "anyOf": [
              {
                "maxLength": 256,
                "minLength": 1,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Optional idempotency key for request-level deduplication",
            "title": "Idempotency Key"
          },
          "raw_event": {
            "additionalProperties": true,
            "description": "The raw SDK event payload",
            "title": "Raw Event",
            "type": "object"
          },
          "sdk_type": {
            "description": "SDK type identifier (e.g., 'claude', 'codex', 'terminal_use')",
            "minLength": 1,
            "title": "Sdk Type",
            "type": "string"
          },
          "sdk_version": {
            "description": "SDK version in semver format (e.g., '0.1.22')",
            "title": "Sdk Version",
            "type": "string"
          },
          "task_id": {
            "description": "Task ID to publish the event to",
            "title": "Task Id",
            "type": "string"
          }
        },
        "required": [
          "sdk_type",
          "sdk_version",
          "task_id",
          "raw_event"
        ],
        "title": "RawEventPayload",
        "type": "object"
      },
      "ReasoningDeltaPart": {
        "description": "Incremental reasoning content.",
        "properties": {
          "id": {
            "description": "ID of the reasoning block this belongs to",
            "title": "Id",
            "type": "string"
          },
          "metadata": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/StreamMetadata"
              },
              {
                "type": "null"
              }
            ],
            "description": "Metadata including parentToolUseId for subagents"
          },
          "text": {
            "description": "Reasoning delta content",
            "title": "Text",
            "type": "string"
          },
          "type": {
            "const": "reasoning-delta",
            "default": "reasoning-delta",
            "title": "Type",
            "type": "string"
          }
        },
        "required": [
          "id",
          "text"
        ],
        "title": "ReasoningDeltaPart",
        "type": "object"
      },
      "ReasoningEndPart": {
        "description": "Marks the end of a reasoning block.",
        "properties": {
          "id": {
            "description": "ID of the completed reasoning block",
            "title": "Id",
            "type": "string"
          },
          "metadata": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/StreamMetadata"
              },
              {
                "type": "null"
              }
            ],
            "description": "Metadata including parentToolUseId for subagents"
          },
          "type": {
            "const": "reasoning-end",
            "default": "reasoning-end",
            "title": "Type",
            "type": "string"
          }
        },
        "required": [
          "id"
        ],
        "title": "ReasoningEndPart",
        "type": "object"
      },
      "ReasoningPart": {
        "description": "Reasoning/thinking content part (Claude's extended thinking).",
        "properties": {
          "providerMetadata": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "description": "Provider-specific metadata (e.g., Claude's thinking.signature)",
            "title": "Providermetadata"
          },
          "text": {
            "description": "The reasoning text content",
            "title": "Text",
            "type": "string"
          },
          "type": {
            "const": "reasoning",
            "default": "reasoning",
            "description": "Part type discriminator",
            "title": "Type",
            "type": "string"
          }
        },
        "required": [
          "text"
        ],
        "title": "ReasoningPart",
        "type": "object"
      },
      "ReasoningStartPart": {
        "description": "Marks the start of a reasoning block.",
        "properties": {
          "id": {
            "description": "Unique ID for this reasoning block",
            "title": "Id",
            "type": "string"
          },
          "metadata": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/StreamMetadata"
              },
              {
                "type": "null"
              }
            ],
            "description": "Metadata including parentToolUseId for subagents"
          },
          "type": {
            "const": "reasoning-start",
            "default": "reasoning-start",
            "title": "Type",
            "type": "string"
          }
        },
        "required": [
          "id"
        ],
        "title": "ReasoningStartPart",
        "type": "object"
      },
      "RedeployResponse": {
        "description": "Response from a redeploy operation.",
        "properties": {
          "branch_id": {
            "description": "Branch ID",
            "title": "Branch Id",
            "type": "string"
          },
          "message": {
            "description": "Human-readable status message",
            "title": "Message",
            "type": "string"
          },
          "version_id": {
            "description": "New version ID created for redeploy",
            "title": "Version Id",
            "type": "string"
          },
          "version_status": {
            "$ref": "#/components/schemas/VersionStatus",
            "description": "Version status after redeploy"
          }
        },
        "required": [
          "branch_id",
          "version_id",
          "version_status",
          "message"
        ],
        "title": "RedeployResponse",
        "type": "object"
      },
      "RegisterContainerRequest": {
        "description": "Request model for container registration.\n\nCalled by agent container on startup to register its ACP URL.\nIncludes a registration token for security (CVE-2026-0001 fix).",
        "properties": {
          "acp_url": {
            "description": "ACP server URL (e.g., 'http://agent-main-abc123.agents.svc.cluster.local:8000')",
            "title": "Acp Url",
            "type": "string"
          },
          "branch_id": {
            "description": "Branch ID",
            "title": "Branch Id",
            "type": "string"
          },
          "registration_token": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Single-use registration token provided during deployment (required when configured)",
            "title": "Registration Token"
          },
          "version_id": {
            "description": "Version ID being registered",
            "title": "Version Id",
            "type": "string"
          }
        },
        "required": [
          "branch_id",
          "version_id",
          "acp_url"
        ],
        "title": "RegisterContainerRequest",
        "type": "object"
      },
      "RegisterContainerResponse": {
        "description": "Response from container registration.",
        "properties": {
          "agent_api_key": {
            "description": "API key for the agent",
            "title": "Agent Api Key",
            "type": "string"
          },
          "agent_id": {
            "description": "Agent ID",
            "title": "Agent Id",
            "type": "string"
          },
          "agent_name": {
            "description": "Agent name",
            "title": "Agent Name",
            "type": "string"
          },
          "branch_id": {
            "description": "Branch ID",
            "title": "Branch Id",
            "type": "string"
          },
          "version_status": {
            "$ref": "#/components/schemas/VersionStatus",
            "description": "Version status after registration"
          }
        },
        "required": [
          "agent_id",
          "agent_name",
          "agent_api_key",
          "branch_id",
          "version_status"
        ],
        "title": "RegisterContainerResponse",
        "type": "object"
      },
      "RegistryAuthResponse": {
        "description": "Response containing short-lived registry credentials for pushing agent images.",
        "properties": {
          "expires_at": {
            "description": "Token expiration timestamp (typically ~1 hour from issuance)",
            "format": "date-time",
            "title": "Expires At",
            "type": "string"
          },
          "registry_url": {
            "description": "Docker registry host URL (e.g., us-east4-docker.pkg.dev)",
            "title": "Registry Url",
            "type": "string"
          },
          "repository": {
            "description": "Repository path within the registry (e.g., project-id/agents)",
            "title": "Repository",
            "type": "string"
          },
          "token": {
            "description": "Short-lived OAuth2 access token for docker login",
            "title": "Token",
            "type": "string"
          },
          "username": {
            "default": "oauth2accesstoken",
            "description": "Username for docker login (always 'oauth2accesstoken' for GCP)",
            "title": "Username",
            "type": "string"
          }
        },
        "required": [
          "registry_url",
          "repository",
          "token",
          "expires_at"
        ],
        "title": "RegistryAuthResponse",
        "type": "object"
      },
      "ResolveEnvResponse": {
        "description": "Response for resolving which environment matches a branch.",
        "properties": {
          "branch": {
            "description": "The branch that was resolved",
            "title": "Branch",
            "type": "string"
          },
          "environment": {
            "$ref": "#/components/schemas/EnvResponse",
            "description": "The environment that matches the branch"
          }
        },
        "required": [
          "environment",
          "branch"
        ],
        "title": "ResolveEnvResponse",
        "type": "object"
      },
      "RollbackRequest": {
        "description": "Request model for rolling back a branch.",
        "properties": {
          "target_version_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Version ID to rollback to (defaults to previous version if not specified)",
            "title": "Target Version Id"
          }
        },
        "title": "RollbackRequest",
        "type": "object"
      },
      "RollbackResponse": {
        "description": "Response from a rollback operation.",
        "properties": {
          "branch_id": {
            "description": "Branch ID",
            "title": "Branch Id",
            "type": "string"
          },
          "from_git_hash": {
            "description": "Git hash of the previous version",
            "title": "From Git Hash",
            "type": "string"
          },
          "from_version_id": {
            "description": "Version ID that was rolled back FROM",
            "title": "From Version Id",
            "type": "string"
          },
          "message": {
            "description": "Human-readable status message",
            "title": "Message",
            "type": "string"
          },
          "to_git_hash": {
            "description": "Git hash of the target version",
            "title": "To Git Hash",
            "type": "string"
          },
          "to_version_id": {
            "description": "Version ID that was rolled back TO",
            "title": "To Version Id",
            "type": "string"
          },
          "version_status": {
            "$ref": "#/components/schemas/VersionStatus",
            "description": "Target version status"
          }
        },
        "required": [
          "branch_id",
          "from_version_id",
          "to_version_id",
          "from_git_hash",
          "to_git_hash",
          "version_status",
          "message"
        ],
        "title": "RollbackResponse",
        "type": "object"
      },
      "SDKType": {
        "description": "SDK type for agent runtime.",
        "enum": [
          "claude_agent_sdk",
          "codex_agent_sdk"
        ],
        "title": "SDKType",
        "type": "string"
      },
      "ScheduleActionInfo": {
        "description": "Information about the scheduled action",
        "properties": {
          "task_queue": {
            "description": "Task queue for the workflow",
            "title": "Task Queue",
            "type": "string"
          },
          "workflow_id_prefix": {
            "description": "Prefix for workflow execution IDs",
            "title": "Workflow ID Prefix",
            "type": "string"
          },
          "workflow_name": {
            "description": "Name of the workflow being executed",
            "title": "Workflow Name",
            "type": "string"
          },
          "workflow_params": {
            "anyOf": [
              {
                "items": {},
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "description": "Parameters passed to the workflow",
            "title": "Workflow Parameters"
          }
        },
        "required": [
          "workflow_name",
          "workflow_id_prefix",
          "task_queue"
        ],
        "title": "ScheduleActionInfo",
        "type": "object"
      },
      "ScheduleListItem": {
        "description": "Abbreviated schedule info for list responses",
        "properties": {
          "agent_id": {
            "description": "ID of the agent this schedule belongs to",
            "title": "Agent ID",
            "type": "string"
          },
          "name": {
            "description": "Human-readable name for the schedule",
            "title": "Schedule Name",
            "type": "string"
          },
          "next_action_time": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Next scheduled execution time",
            "title": "Next Action Time"
          },
          "schedule_id": {
            "description": "Unique identifier for the schedule",
            "title": "Schedule ID",
            "type": "string"
          },
          "state": {
            "$ref": "#/components/schemas/ScheduleState",
            "description": "Current state of the schedule",
            "title": "State"
          },
          "workflow_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Name of the scheduled workflow",
            "title": "Workflow Name"
          }
        },
        "required": [
          "schedule_id",
          "name",
          "agent_id",
          "state"
        ],
        "title": "ScheduleListItem",
        "type": "object"
      },
      "ScheduleListResponse": {
        "description": "Response model for listing schedules",
        "properties": {
          "schedules": {
            "description": "List of schedules",
            "items": {
              "$ref": "#/components/schemas/ScheduleListItem"
            },
            "title": "Schedules",
            "type": "array"
          },
          "total": {
            "description": "Total number of schedules",
            "title": "Total",
            "type": "integer"
          }
        },
        "required": [
          "schedules",
          "total"
        ],
        "title": "ScheduleListResponse",
        "type": "object"
      },
      "ScheduleResponse": {
        "description": "Response model for schedule operations",
        "properties": {
          "action": {
            "$ref": "#/components/schemas/ScheduleActionInfo",
            "title": "Action"
          },
          "agent_id": {
            "description": "ID of the agent this schedule belongs to",
            "title": "Agent ID",
            "type": "string"
          },
          "created_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "When the schedule was created",
            "title": "Created At"
          },
          "last_action_time": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "When the schedule last executed",
            "title": "Last Action Time"
          },
          "name": {
            "description": "Human-readable name for the schedule",
            "title": "Schedule Name",
            "type": "string"
          },
          "next_action_times": {
            "description": "Upcoming scheduled execution times",
            "items": {
              "format": "date-time",
              "type": "string"
            },
            "title": "Next Action Times",
            "type": "array"
          },
          "num_actions_missed": {
            "default": 0,
            "description": "Number of scheduled executions that were missed",
            "title": "Number of Actions Missed",
            "type": "integer"
          },
          "num_actions_taken": {
            "default": 0,
            "description": "Number of times the schedule has executed",
            "title": "Number of Actions Taken",
            "type": "integer"
          },
          "schedule_id": {
            "description": "Unique identifier for the schedule",
            "title": "Schedule ID",
            "type": "string"
          },
          "spec": {
            "$ref": "#/components/schemas/ScheduleSpecInfo",
            "description": "Schedule specification",
            "title": "Spec"
          },
          "state": {
            "$ref": "#/components/schemas/ScheduleState",
            "description": "Current state of the schedule",
            "title": "State"
          }
        },
        "required": [
          "schedule_id",
          "name",
          "agent_id",
          "state",
          "action",
          "spec"
        ],
        "title": "ScheduleResponse",
        "type": "object"
      },
      "ScheduleSpecInfo": {
        "description": "Information about the schedule specification",
        "properties": {
          "cron_expressions": {
            "description": "Cron expressions for the schedule",
            "items": {
              "type": "string"
            },
            "title": "Cron Expressions",
            "type": "array"
          },
          "end_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "When the schedule stops being active",
            "title": "End At"
          },
          "intervals_seconds": {
            "description": "Interval specifications in seconds",
            "items": {
              "type": "integer"
            },
            "title": "Interval Seconds",
            "type": "array"
          },
          "start_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "When the schedule starts being active",
            "title": "Start At"
          }
        },
        "title": "ScheduleSpecInfo",
        "type": "object"
      },
      "ScheduleState": {
        "description": "Schedule state enum",
        "enum": [
          "ACTIVE",
          "PAUSED"
        ],
        "title": "ScheduleState",
        "type": "string"
      },
      "SearchResponse": {
        "description": "Response from the search endpoint.",
        "properties": {
          "query": {
            "description": "The search query that was used",
            "title": "Query",
            "type": "string"
          },
          "results": {
            "description": "List of search results",
            "items": {
              "$ref": "#/components/schemas/SearchResultItem"
            },
            "title": "Results",
            "type": "array"
          },
          "total": {
            "description": "Total number of results across all types",
            "title": "Total",
            "type": "integer"
          }
        },
        "required": [
          "total",
          "query"
        ],
        "title": "SearchResponse",
        "type": "object"
      },
      "SearchResultItem": {
        "description": "A single search result item.",
        "properties": {
          "id": {
            "description": "The unique identifier",
            "title": "Id",
            "type": "string"
          },
          "name": {
            "description": "The display name",
            "title": "Name",
            "type": "string"
          },
          "namespace_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "The namespace this resource belongs to",
            "title": "Namespace Id"
          },
          "status": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "The current status",
            "title": "Status"
          },
          "type": {
            "$ref": "#/components/schemas/SearchResultType",
            "description": "The type of resource"
          }
        },
        "required": [
          "type",
          "id",
          "name"
        ],
        "title": "SearchResultItem",
        "type": "object"
      },
      "SearchResultType": {
        "description": "Types of resources that can be returned in search results.",
        "enum": [
          "agent",
          "task",
          "workspace"
        ],
        "title": "SearchResultType",
        "type": "string"
      },
      "SetEnvVarRequest": {
        "description": "Request to set environment variable(s).\n\nMatches design spec (deployment-addendum-rollback-and-envvars.md):\n{\n    \"secrets\": {\n        \"OPENAI_API_KEY\": {\"value\": \"sk-xxx\", \"is_secret\": true},\n        \"LOG_LEVEL\": {\"value\": \"debug\", \"is_secret\": false}\n    },\n    \"redeploy\": true\n}",
        "properties": {
          "redeploy": {
            "default": true,
            "description": "If true and env has active deployment, trigger redeploy with new secrets",
            "title": "Redeploy",
            "type": "boolean"
          },
          "secrets": {
            "additionalProperties": {
              "$ref": "#/components/schemas/EnvVarValue"
            },
            "description": "Dict of {key: {value, is_secret}} to set",
            "examples": [
              {
                "LOG_LEVEL": {
                  "is_secret": false,
                  "value": "debug"
                },
                "OPENAI_API_KEY": {
                  "is_secret": true,
                  "value": "sk-xxx"
                }
              }
            ],
            "title": "Secrets",
            "type": "object"
          }
        },
        "required": [
          "secrets"
        ],
        "title": "SetEnvVarRequest",
        "type": "object"
      },
      "SetEnvVarResponse": {
        "description": "Response after setting environment variables.",
        "properties": {
          "count": {
            "description": "Number of variables set",
            "title": "Count",
            "type": "integer"
          },
          "redeployed": {
            "default": false,
            "description": "Whether a redeploy was triggered",
            "title": "Redeployed",
            "type": "boolean"
          },
          "updated": {
            "description": "Keys that were set",
            "items": {
              "type": "string"
            },
            "title": "Updated",
            "type": "array"
          },
          "version_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "New version ID if redeployed",
            "title": "Version Id"
          }
        },
        "required": [
          "updated",
          "count"
        ],
        "title": "SetEnvVarResponse",
        "type": "object"
      },
      "SingleFileUploadResponse": {
        "description": "Response model for single-file upload operations.",
        "properties": {
          "archive_version": {
            "description": "New archive version token after this commit.",
            "title": "Archive Version",
            "type": "string"
          },
          "created": {
            "description": "True when the upload created a previously missing file.",
            "title": "Created",
            "type": "boolean"
          },
          "file_version": {
            "description": "New per-file version token (SHA256 of file content).",
            "title": "File Version",
            "type": "string"
          },
          "filesystem_id": {
            "description": "The filesystem ID.",
            "title": "Filesystem Id",
            "type": "string"
          },
          "path": {
            "description": "Normalized relative path written.",
            "title": "Path",
            "type": "string"
          },
          "size_bytes": {
            "description": "Uploaded file size in bytes.",
            "title": "Size Bytes",
            "type": "integer"
          },
          "write_mode": {
            "$ref": "#/components/schemas/FileUploadWriteMode",
            "description": "Applied upload write mode."
          }
        },
        "required": [
          "filesystem_id",
          "path",
          "write_mode",
          "created",
          "size_bytes",
          "file_version",
          "archive_version"
        ],
        "title": "SingleFileUploadResponse",
        "type": "object"
      },
      "SlugAvailabilityResponse": {
        "description": "Response for slug availability check.",
        "properties": {
          "available": {
            "description": "Whether the slug is available for use.",
            "title": "Available",
            "type": "boolean"
          },
          "slug": {
            "description": "The slug that was checked.",
            "title": "Slug",
            "type": "string"
          }
        },
        "required": [
          "available",
          "slug"
        ],
        "title": "SlugAvailabilityResponse",
        "type": "object"
      },
      "SourceUrlPart": {
        "description": "Source URL reference part.",
        "properties": {
          "sourceId": {
            "description": "Unique source ID",
            "title": "Sourceid",
            "type": "string"
          },
          "title": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Title of the source",
            "title": "Title"
          },
          "type": {
            "const": "source-url",
            "default": "source-url",
            "description": "Part type discriminator",
            "title": "Type",
            "type": "string"
          },
          "url": {
            "description": "URL of the source",
            "title": "Url",
            "type": "string"
          }
        },
        "required": [
          "sourceId",
          "url"
        ],
        "title": "SourceUrlPart",
        "type": "object"
      },
      "Span": {
        "properties": {
          "data": {
            "additionalProperties": true,
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "items": {
                  "additionalProperties": true,
                  "type": "object"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "description": "Any additional metadata or context for the span",
            "title": "Additional data associated with the span"
          },
          "end_time": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "The time the span ended",
            "title": "The end time of the span"
          },
          "id": {
            "title": "Unique Span ID",
            "type": "string"
          },
          "input": {
            "additionalProperties": true,
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "items": {
                  "additionalProperties": true,
                  "type": "object"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "description": "Input parameters or data for the operation",
            "title": "The input data for the span"
          },
          "name": {
            "description": "Name that describes what operation this span represents",
            "title": "The name of the span",
            "type": "string"
          },
          "output": {
            "additionalProperties": true,
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "items": {
                  "additionalProperties": true,
                  "type": "object"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "description": "Output data resulting from the operation",
            "title": "The output data from the span"
          },
          "parent_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "ID of the parent span if this is a child span in a trace",
            "title": "The parent span ID if this is a child span"
          },
          "start_time": {
            "description": "The time the span started",
            "format": "date-time",
            "title": "The start time of the span",
            "type": "string"
          },
          "task_id": {
            "description": "ID of the task this span is associated with, used for authorization",
            "title": "The task ID this span belongs to",
            "type": "string"
          },
          "trace_id": {
            "description": "Unique identifier for the trace this span belongs to",
            "title": "The trace ID for this span",
            "type": "string"
          }
        },
        "required": [
          "id",
          "task_id",
          "trace_id",
          "name",
          "start_time"
        ],
        "title": "Span",
        "type": "object"
      },
      "StartPart": {
        "description": "Marks the start of a streaming session.",
        "properties": {
          "type": {
            "const": "start",
            "default": "start",
            "title": "Type",
            "type": "string"
          }
        },
        "title": "StartPart",
        "type": "object"
      },
      "StartStepPart": {
        "description": "Marks the start of a new step (API call).",
        "properties": {
          "metadata": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/StreamMetadata"
              },
              {
                "type": "null"
              }
            ],
            "description": "Metadata including parentToolUseId for subagents"
          },
          "request": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "description": "Request details for this step",
            "title": "Request"
          },
          "type": {
            "const": "start-step",
            "default": "start-step",
            "title": "Type",
            "type": "string"
          },
          "warnings": {
            "anyOf": [
              {
                "items": {},
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "description": "Warnings from this step",
            "title": "Warnings"
          }
        },
        "title": "StartStepPart",
        "type": "object"
      },
      "State": {
        "description": "Represents a state in the agent system. A state is associated uniquely with a task and an agent.\n\nThis entity is used to store states in MongoDB, with each state\nassociated with a specific task and agent. The combination of task_id and agent_id is globally unique.\n\nThe state is a dictionary of arbitrary data.",
        "properties": {
          "agent_id": {
            "title": "The unique id of the agent to send the state to",
            "type": "string"
          },
          "created_at": {
            "description": "The timestamp when the state was created",
            "format": "date-time",
            "title": "Created At",
            "type": "string"
          },
          "id": {
            "description": "The task state's unique id",
            "title": "Id",
            "type": "string"
          },
          "state": {
            "additionalProperties": true,
            "title": "The state to send to the task.",
            "type": "object"
          },
          "task_id": {
            "title": "The unique id of the task to send the state to",
            "type": "string"
          },
          "updated_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "The timestamp when the state was last updated",
            "title": "Updated At"
          }
        },
        "required": [
          "task_id",
          "agent_id",
          "state",
          "id",
          "created_at"
        ],
        "title": "State",
        "type": "object"
      },
      "StreamErrorPart": {
        "description": "Error during streaming.",
        "properties": {
          "error": {
            "description": "Error message",
            "title": "Error",
            "type": "string"
          },
          "rawContent": {
            "anyOf": [
              {},
              {
                "type": "null"
              }
            ],
            "description": "Original content that caused the error",
            "title": "Rawcontent"
          },
          "type": {
            "const": "error",
            "default": "error",
            "title": "Type",
            "type": "string"
          }
        },
        "required": [
          "error"
        ],
        "title": "StreamErrorPart",
        "type": "object"
      },
      "StreamMetadata": {
        "description": "Extended metadata for finish events.",
        "properties": {
          "cacheCreationInputTokens": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "description": "Cache creation input tokens",
            "title": "Cachecreationinputtokens"
          },
          "cacheReadInputTokens": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "description": "Cache read input tokens",
            "title": "Cachereadinputtokens"
          },
          "costUsd": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "description": "Total cost in USD",
            "title": "Costusd"
          },
          "durationMs": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "description": "Total duration in milliseconds",
            "title": "Durationms"
          },
          "parentToolUseId": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Parent tool use ID for subagent context",
            "title": "Parenttooluseid"
          }
        },
        "title": "StreamMetadata",
        "type": "object"
      },
      "StreamUsage": {
        "description": "Token usage for streaming events.",
        "properties": {
          "inputTokens": {
            "description": "Input tokens used",
            "title": "Inputtokens",
            "type": "integer"
          },
          "outputTokens": {
            "description": "Output tokens used",
            "title": "Outputtokens",
            "type": "integer"
          },
          "totalTokens": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "description": "Total tokens",
            "title": "Totaltokens"
          }
        },
        "required": [
          "inputTokens",
          "outputTokens"
        ],
        "title": "StreamUsage",
        "type": "object"
      },
      "SyncCompleteRequest": {
        "description": "Request model for completing a sync operation.",
        "properties": {
          "archive_checksum": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "SHA256 checksum of the archive.",
            "title": "Archive Checksum"
          },
          "archive_size_bytes": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "description": "Size of the archive in bytes.",
            "title": "Archive Size Bytes"
          },
          "direction": {
            "description": "Sync direction: 'UP' or 'DOWN'.",
            "title": "Direction",
            "type": "string"
          },
          "files": {
            "anyOf": [
              {
                "items": {
                  "$ref": "#/components/schemas/FilesystemFile"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "description": "List of files in the filesystem (empty if status is FAILED).",
            "title": "Files"
          },
          "status": {
            "description": "Sync status: 'SUCCESS' or 'FAILED'.",
            "title": "Status",
            "type": "string"
          },
          "sync_id": {
            "description": "Unique ID for this sync operation (idempotency key).",
            "title": "Sync Id",
            "type": "string"
          }
        },
        "required": [
          "sync_id",
          "direction",
          "status"
        ],
        "title": "SyncCompleteRequest",
        "type": "object"
      },
      "SyncCompleteResponse": {
        "description": "Response model for sync-complete operation.",
        "properties": {
          "files_count": {
            "description": "Number of files processed.",
            "title": "Files Count",
            "type": "integer"
          },
          "filesystem_id": {
            "description": "The filesystem ID.",
            "title": "Filesystem Id",
            "type": "string"
          },
          "status": {
            "description": "Result status: 'COMPLETED' or 'ALREADY_PROCESSED'.",
            "title": "Status",
            "type": "string"
          },
          "sync_id": {
            "description": "The sync operation ID (for idempotency).",
            "title": "Sync Id",
            "type": "string"
          }
        },
        "required": [
          "filesystem_id",
          "sync_id",
          "files_count",
          "status"
        ],
        "title": "SyncCompleteResponse",
        "type": "object"
      },
      "SystemFolderResponse": {
        "description": "Response model for a task's system folder record.",
        "properties": {
          "archive_checksum": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "SHA256 checksum of the archive. NULL means never synced.",
            "title": "Archive Checksum"
          },
          "archive_size_bytes": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "description": "Size of the archive in bytes after last sync.",
            "title": "Archive Size Bytes"
          },
          "created_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "The timestamp when this record was created.",
            "title": "Created At"
          },
          "folder_type": {
            "description": "The type of system folder (e.g., 'dot_claude').",
            "title": "Folder Type",
            "type": "string"
          },
          "id": {
            "description": "The unique identifier of this record.",
            "title": "Id",
            "type": "string"
          },
          "last_synced_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Timestamp of the last successful sync operation.",
            "title": "Last Synced At"
          },
          "sync_status": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Current sync status: PENDING, SYNCING, SUCCESS, or FAILED.",
            "title": "Sync Status"
          },
          "task_id": {
            "description": "The task this system folder belongs to.",
            "title": "Task Id",
            "type": "string"
          },
          "updated_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "The timestamp when this record was last updated.",
            "title": "Updated At"
          }
        },
        "required": [
          "id",
          "task_id",
          "folder_type"
        ],
        "title": "SystemFolderResponse",
        "type": "object"
      },
      "SystemFolderSyncCompleteRequest": {
        "description": "Request model for completing a system folder sync operation.",
        "properties": {
          "archive_checksum": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "SHA256 checksum of the archive.",
            "title": "Archive Checksum"
          },
          "archive_size_bytes": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "description": "Size of the archive in bytes.",
            "title": "Archive Size Bytes"
          },
          "direction": {
            "description": "Sync direction: 'UP' or 'DOWN'.",
            "title": "Direction",
            "type": "string"
          },
          "status": {
            "description": "Sync status: 'SUCCESS' or 'FAILED'.",
            "title": "Status",
            "type": "string"
          },
          "sync_id": {
            "description": "Unique ID for this sync operation (idempotency key).",
            "title": "Sync Id",
            "type": "string"
          }
        },
        "required": [
          "sync_id",
          "direction",
          "status"
        ],
        "title": "SystemFolderSyncCompleteRequest",
        "type": "object"
      },
      "SystemFolderSyncCompleteResponse": {
        "description": "Response model for system folder sync-complete operation.",
        "properties": {
          "folder_type": {
            "description": "The system folder type.",
            "title": "Folder Type",
            "type": "string"
          },
          "status": {
            "description": "Result status: 'COMPLETED'.",
            "title": "Status",
            "type": "string"
          },
          "sync_id": {
            "description": "The sync operation ID (for idempotency).",
            "title": "Sync Id",
            "type": "string"
          },
          "task_id": {
            "description": "The task ID.",
            "title": "Task Id",
            "type": "string"
          }
        },
        "required": [
          "task_id",
          "folder_type",
          "sync_id",
          "status"
        ],
        "title": "SystemFolderSyncCompleteResponse",
        "type": "object"
      },
      "SystemFolderType": {
        "description": "Enumeration of system folder types that can be synced per-task.",
        "enum": [
          "dot_claude",
          "dot_codex"
        ],
        "title": "SystemFolderType",
        "type": "string"
      },
      "SystemFolderTypeResponse": {
        "description": "Response model for a system folder type from the registry.",
        "properties": {
          "host_path": {
            "description": "Relative path from $DATA_ROOT/tasks/{task_id}/ on the host.",
            "title": "Host Path",
            "type": "string"
          },
          "sandbox_mount_path": {
            "description": "Absolute path where this folder is mounted in the sandbox.",
            "title": "Sandbox Mount Path",
            "type": "string"
          },
          "type": {
            "description": "The system folder type identifier (e.g., 'dot_claude').",
            "title": "Type",
            "type": "string"
          }
        },
        "required": [
          "type",
          "host_path",
          "sandbox_mount_path"
        ],
        "title": "SystemFolderTypeResponse",
        "type": "object"
      },
      "Task": {
        "properties": {
          "created_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "The timestamp when the task was created"
          },
          "created_version_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Version ID when task was created (immutable, for audit)"
          },
          "current_version_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Current version for routing (can change on migration)"
          },
          "filesystem_id": {
            "title": "Filesystem ID for persistent filesystem storage",
            "type": "string"
          },
          "id": {
            "title": "Unique Task ID",
            "type": "string"
          },
          "name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Unique name of the task"
          },
          "namespace_id": {
            "title": "Namespace ID (denormalized from agent for GCS path construction)",
            "type": "string"
          },
          "params": {
            "additionalProperties": true,
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Task parameters"
          },
          "status": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/TaskStatus"
              },
              {
                "type": "null"
              }
            ],
            "title": "The current status of the task"
          },
          "status_reason": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "The reason for the current task status"
          },
          "task_metadata": {
            "additionalProperties": true,
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Task metadata"
          },
          "updated_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "The timestamp when the task was last updated"
          }
        },
        "required": [
          "id",
          "filesystem_id",
          "namespace_id"
        ],
        "title": "Task",
        "type": "object"
      },
      "TaskRelationships": {
        "description": "Task relationships that can be loaded",
        "enum": [
          "agents"
        ],
        "title": "TaskRelationships",
        "type": "string"
      },
      "TaskResponse": {
        "description": "Task response model with optional related data based on relationships",
        "properties": {
          "agents": {
            "anyOf": [
              {
                "items": {
                  "$ref": "#/components/schemas/Agent"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Agents associated with this task (only populated when 'agent' view is requested)"
          },
          "created_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "The timestamp when the task was created"
          },
          "created_version_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Version ID when task was created (immutable, for audit)"
          },
          "current_version_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Current version for routing (can change on migration)"
          },
          "filesystem_id": {
            "title": "Filesystem ID for persistent filesystem storage",
            "type": "string"
          },
          "id": {
            "title": "Unique Task ID",
            "type": "string"
          },
          "name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Unique name of the task"
          },
          "namespace_id": {
            "title": "Namespace ID (denormalized from agent for GCS path construction)",
            "type": "string"
          },
          "params": {
            "additionalProperties": true,
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Task parameters"
          },
          "status": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/TaskStatus"
              },
              {
                "type": "null"
              }
            ],
            "title": "The current status of the task"
          },
          "status_reason": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "The reason for the current task status"
          },
          "task_metadata": {
            "additionalProperties": true,
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Task metadata"
          },
          "updated_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "The timestamp when the task was last updated"
          }
        },
        "required": [
          "id",
          "filesystem_id",
          "namespace_id"
        ],
        "title": "TaskResponse",
        "type": "object"
      },
      "TaskStatus": {
        "enum": [
          "IDLE",
          "CANCELED",
          "COMPLETED",
          "FAILED",
          "RUNNING",
          "TERMINATED",
          "TIMED_OUT",
          "DELETED"
        ],
        "title": "TaskStatus",
        "type": "string"
      },
      "TextDeltaPart": {
        "description": "Incremental text content.",
        "properties": {
          "id": {
            "description": "ID of the text block this belongs to",
            "title": "Id",
            "type": "string"
          },
          "metadata": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/StreamMetadata"
              },
              {
                "type": "null"
              }
            ],
            "description": "Metadata including parentToolUseId for subagents"
          },
          "text": {
            "description": "Text delta content",
            "title": "Text",
            "type": "string"
          },
          "type": {
            "const": "text-delta",
            "default": "text-delta",
            "title": "Type",
            "type": "string"
          }
        },
        "required": [
          "id",
          "text"
        ],
        "title": "TextDeltaPart",
        "type": "object"
      },
      "TextEndPart": {
        "description": "Marks the end of a text block.",
        "properties": {
          "id": {
            "description": "ID of the completed text block",
            "title": "Id",
            "type": "string"
          },
          "metadata": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/StreamMetadata"
              },
              {
                "type": "null"
              }
            ],
            "description": "Metadata including parentToolUseId for subagents"
          },
          "type": {
            "const": "text-end",
            "default": "text-end",
            "title": "Type",
            "type": "string"
          }
        },
        "required": [
          "id"
        ],
        "title": "TextEndPart",
        "type": "object"
      },
      "TextPart": {
        "description": "Text content part.",
        "properties": {
          "text": {
            "description": "The text content",
            "title": "Text",
            "type": "string"
          },
          "type": {
            "const": "text",
            "default": "text",
            "description": "Part type discriminator",
            "title": "Type",
            "type": "string"
          }
        },
        "required": [
          "text"
        ],
        "title": "TextPart",
        "type": "object"
      },
      "TextStartPart": {
        "description": "Marks the start of a text block.",
        "properties": {
          "id": {
            "description": "Unique ID for this text block",
            "title": "Id",
            "type": "string"
          },
          "metadata": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/StreamMetadata"
              },
              {
                "type": "null"
              }
            ],
            "description": "Metadata including parentToolUseId for subagents"
          },
          "type": {
            "const": "text-start",
            "default": "text-start",
            "title": "Type",
            "type": "string"
          }
        },
        "required": [
          "id"
        ],
        "title": "TextStartPart",
        "type": "object"
      },
      "TextStreamPartWrapper": {
        "description": "Wrapper for TextStreamPart union for proper serialization.",
        "discriminator": {
          "mapping": {
            "error": "#/components/schemas/StreamErrorPart",
            "finish": "#/components/schemas/FinishPart",
            "finish-step": "#/components/schemas/FinishStepPart",
            "handler-complete": "#/components/schemas/HandlerCompletePart",
            "reasoning-delta": "#/components/schemas/ReasoningDeltaPart",
            "reasoning-end": "#/components/schemas/ReasoningEndPart",
            "reasoning-start": "#/components/schemas/ReasoningStartPart",
            "start": "#/components/schemas/StartPart",
            "start-step": "#/components/schemas/StartStepPart",
            "text-delta": "#/components/schemas/TextDeltaPart",
            "text-end": "#/components/schemas/TextEndPart",
            "text-start": "#/components/schemas/TextStartPart",
            "tool-call": "#/components/schemas/ToolCallPart",
            "tool-input-delta": "#/components/schemas/ToolInputDeltaPart",
            "tool-input-end": "#/components/schemas/ToolInputEndPart",
            "tool-input-start": "#/components/schemas/ToolInputStartPart",
            "tool-result": "#/components/schemas/ToolResultPart"
          },
          "propertyName": "type"
        },
        "oneOf": [
          {
            "$ref": "#/components/schemas/StartPart"
          },
          {
            "$ref": "#/components/schemas/StartStepPart"
          },
          {
            "$ref": "#/components/schemas/FinishStepPart"
          },
          {
            "$ref": "#/components/schemas/FinishPart"
          },
          {
            "$ref": "#/components/schemas/HandlerCompletePart"
          },
          {
            "$ref": "#/components/schemas/TextStartPart"
          },
          {
            "$ref": "#/components/schemas/TextDeltaPart"
          },
          {
            "$ref": "#/components/schemas/TextEndPart"
          },
          {
            "$ref": "#/components/schemas/ReasoningStartPart"
          },
          {
            "$ref": "#/components/schemas/ReasoningDeltaPart"
          },
          {
            "$ref": "#/components/schemas/ReasoningEndPart"
          },
          {
            "$ref": "#/components/schemas/ToolInputStartPart"
          },
          {
            "$ref": "#/components/schemas/ToolInputDeltaPart"
          },
          {
            "$ref": "#/components/schemas/ToolInputEndPart"
          },
          {
            "$ref": "#/components/schemas/ToolCallPart"
          },
          {
            "$ref": "#/components/schemas/ToolResultPart"
          },
          {
            "$ref": "#/components/schemas/StreamErrorPart"
          }
        ],
        "title": "TextStreamPartWrapper"
      },
      "TimeSeriesPoint": {
        "description": "A single time series data point.",
        "properties": {
          "ts": {
            "description": "Timestamp for the data point",
            "format": "date-time",
            "title": "Ts",
            "type": "string"
          },
          "value": {
            "description": "Metric value at timestamp",
            "title": "Value",
            "type": "number"
          }
        },
        "required": [
          "ts",
          "value"
        ],
        "title": "TimeSeriesPoint",
        "type": "object"
      },
      "ToolCallPart": {
        "description": "Complete tool call with parsed input.",
        "properties": {
          "input": {
            "additionalProperties": true,
            "description": "Parsed input arguments",
            "title": "Input",
            "type": "object"
          },
          "metadata": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/StreamMetadata"
              },
              {
                "type": "null"
              }
            ],
            "description": "Metadata including parentToolUseId for subagents"
          },
          "toolCallId": {
            "description": "Unique tool call ID",
            "title": "Toolcallid",
            "type": "string"
          },
          "toolName": {
            "description": "Name of the tool",
            "title": "Toolname",
            "type": "string"
          },
          "type": {
            "const": "tool-call",
            "default": "tool-call",
            "title": "Type",
            "type": "string"
          }
        },
        "required": [
          "toolCallId",
          "toolName",
          "input"
        ],
        "title": "ToolCallPart",
        "type": "object"
      },
      "ToolInputDeltaPart": {
        "description": "Incremental tool input JSON.",
        "properties": {
          "delta": {
            "description": "Partial JSON input",
            "title": "Delta",
            "type": "string"
          },
          "id": {
            "description": "Tool call ID",
            "title": "Id",
            "type": "string"
          },
          "metadata": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/StreamMetadata"
              },
              {
                "type": "null"
              }
            ],
            "description": "Metadata including parentToolUseId for subagents"
          },
          "type": {
            "const": "tool-input-delta",
            "default": "tool-input-delta",
            "title": "Type",
            "type": "string"
          }
        },
        "required": [
          "id",
          "delta"
        ],
        "title": "ToolInputDeltaPart",
        "type": "object"
      },
      "ToolInputEndPart": {
        "description": "Marks the end of tool input streaming.",
        "properties": {
          "id": {
            "description": "Tool call ID",
            "title": "Id",
            "type": "string"
          },
          "metadata": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/StreamMetadata"
              },
              {
                "type": "null"
              }
            ],
            "description": "Metadata including parentToolUseId for subagents"
          },
          "type": {
            "const": "tool-input-end",
            "default": "tool-input-end",
            "title": "Type",
            "type": "string"
          }
        },
        "required": [
          "id"
        ],
        "title": "ToolInputEndPart",
        "type": "object"
      },
      "ToolInputStartPart": {
        "description": "Marks the start of tool input streaming.",
        "properties": {
          "id": {
            "description": "Tool call ID (e.g., toolu_01XYZ)",
            "title": "Id",
            "type": "string"
          },
          "metadata": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/StreamMetadata"
              },
              {
                "type": "null"
              }
            ],
            "description": "Metadata including parentToolUseId for subagents"
          },
          "toolName": {
            "description": "Name of the tool",
            "title": "Toolname",
            "type": "string"
          },
          "type": {
            "const": "tool-input-start",
            "default": "tool-input-start",
            "title": "Type",
            "type": "string"
          }
        },
        "required": [
          "id",
          "toolName"
        ],
        "title": "ToolInputStartPart",
        "type": "object"
      },
      "ToolPart": {
        "description": "Tool invocation and result part.",
        "properties": {
          "errorText": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Error message if tool failed",
            "title": "Errortext"
          },
          "input": {
            "additionalProperties": true,
            "description": "Input arguments for the tool",
            "title": "Input",
            "type": "object"
          },
          "output": {
            "anyOf": [
              {},
              {
                "type": "null"
              }
            ],
            "description": "Output from the tool",
            "title": "Output"
          },
          "state": {
            "$ref": "#/components/schemas/ToolPartState",
            "description": "Current state of the tool execution"
          },
          "toolCallId": {
            "description": "Unique ID for this tool call",
            "title": "Toolcallid",
            "type": "string"
          },
          "toolName": {
            "description": "Name of the tool",
            "title": "Toolname",
            "type": "string"
          },
          "type": {
            "const": "tool",
            "default": "tool",
            "description": "Part type discriminator",
            "title": "Type",
            "type": "string"
          }
        },
        "required": [
          "toolCallId",
          "toolName",
          "state",
          "input"
        ],
        "title": "ToolPart",
        "type": "object"
      },
      "ToolPartState": {
        "description": "State of a tool part.",
        "enum": [
          "input-streaming",
          "input-available",
          "output-available",
          "output-error"
        ],
        "title": "ToolPartState",
        "type": "string"
      },
      "ToolResultPart": {
        "description": "Tool execution result.",
        "properties": {
          "metadata": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/StreamMetadata"
              },
              {
                "type": "null"
              }
            ],
            "description": "Metadata including parentToolUseId for subagents"
          },
          "output": {
            "description": "Tool output",
            "title": "Output"
          },
          "toolCallId": {
            "description": "Tool call ID",
            "title": "Toolcallid",
            "type": "string"
          },
          "toolName": {
            "description": "Name of the tool",
            "title": "Toolname",
            "type": "string"
          },
          "type": {
            "const": "tool-result",
            "default": "tool-result",
            "title": "Type",
            "type": "string"
          }
        },
        "required": [
          "toolCallId",
          "toolName",
          "output"
        ],
        "title": "ToolResultPart",
        "type": "object"
      },
      "TraceIngestionRequest": {
        "description": "OTLP trace data in JSON format.\n\nSee: https://opentelemetry.io/docs/specs/otlp/#otlphttp",
        "properties": {
          "resourceSpans": {
            "description": "Array of ResourceSpans as per OTLP JSON format",
            "items": {
              "additionalProperties": true,
              "type": "object"
            },
            "maxItems": 1000,
            "title": "Resourcespans",
            "type": "array"
          }
        },
        "required": [
          "resourceSpans"
        ],
        "title": "TraceIngestionRequest",
        "type": "object"
      },
      "TraceIngestionResponse": {
        "description": "Response from trace ingestion.",
        "properties": {
          "spans_count": {
            "description": "Number of spans ingested",
            "title": "Spans Count",
            "type": "integer"
          },
          "status": {
            "default": "accepted",
            "title": "Status",
            "type": "string"
          }
        },
        "required": [
          "spans_count"
        ],
        "title": "TraceIngestionResponse",
        "type": "object"
      },
      "UIMessage": {
        "description": "Vercel AI SDK compatible message format.\n\nBased on: https://ai-sdk.dev/docs/reference/ai-sdk-core/ui-message\nwith extensions for our use case.",
        "examples": [
          {
            "createdAt": "2024-01-01T00:00:00Z",
            "id": "msg_01ABC",
            "parts": [
              {
                "text": "Hello, how can I help?",
                "type": "text"
              }
            ],
            "role": "assistant"
          }
        ],
        "properties": {
          "createdAt": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "ISO timestamp when created",
            "title": "Createdat"
          },
          "id": {
            "description": "Unique message ID",
            "title": "Id",
            "type": "string"
          },
          "metadata": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/UIMessageMetadata"
              },
              {
                "type": "null"
              }
            ],
            "description": "Message metadata"
          },
          "parts": {
            "description": "Content parts of the message",
            "items": {
              "$ref": "#/components/schemas/UIMessagePartWrapper"
            },
            "minItems": 1,
            "title": "Parts",
            "type": "array"
          },
          "role": {
            "$ref": "#/components/schemas/UIMessageRole",
            "description": "Role of the message author"
          }
        },
        "required": [
          "id",
          "role",
          "parts"
        ],
        "title": "UIMessage",
        "type": "object"
      },
      "UIMessageMetadata": {
        "description": "Metadata for a UIMessage.",
        "properties": {
          "costUsd": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "description": "Cost in USD for this message",
            "title": "Costusd"
          },
          "durationMs": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "description": "Duration in milliseconds",
            "title": "Durationms"
          },
          "model": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Model used to generate message",
            "title": "Model"
          },
          "parentToolUseId": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Parent tool use ID for subagent context",
            "title": "Parenttooluseid"
          },
          "usage": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/Usage"
              },
              {
                "type": "null"
              }
            ],
            "description": "Token usage for this message"
          }
        },
        "title": "UIMessageMetadata",
        "type": "object"
      },
      "UIMessagePartWrapper": {
        "description": "Wrapper for UIMessagePart union for proper serialization.",
        "discriminator": {
          "mapping": {
            "data": "#/components/schemas/DataPart",
            "error": "#/components/schemas/ErrorPart",
            "file": "#/components/schemas/FilePart",
            "reasoning": "#/components/schemas/ReasoningPart",
            "source-url": "#/components/schemas/SourceUrlPart",
            "text": "#/components/schemas/TextPart",
            "tool": "#/components/schemas/ToolPart"
          },
          "propertyName": "type"
        },
        "oneOf": [
          {
            "$ref": "#/components/schemas/TextPart"
          },
          {
            "$ref": "#/components/schemas/ReasoningPart"
          },
          {
            "$ref": "#/components/schemas/ToolPart"
          },
          {
            "$ref": "#/components/schemas/SourceUrlPart"
          },
          {
            "$ref": "#/components/schemas/FilePart"
          },
          {
            "$ref": "#/components/schemas/DataPart"
          },
          {
            "$ref": "#/components/schemas/ErrorPart"
          }
        ],
        "title": "UIMessagePartWrapper"
      },
      "UIMessageRole": {
        "description": "Role of the message author.",
        "enum": [
          "system",
          "user",
          "assistant"
        ],
        "title": "UIMessageRole",
        "type": "string"
      },
      "UnpauseScheduleRequest": {
        "description": "Request model for unpausing a schedule",
        "properties": {
          "note": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Optional note explaining why the schedule was unpaused",
            "title": "Note"
          }
        },
        "title": "UnpauseScheduleRequest",
        "type": "object"
      },
      "UpdateAccessGroupRequest": {
        "properties": {
          "description": {
            "anyOf": [
              {
                "maxLength": 1000,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Optional group description.",
            "title": "Description"
          }
        },
        "title": "UpdateAccessGroupRequest",
        "type": "object"
      },
      "UpdateAgentTaskTrackerRequest": {
        "description": "Request model for updating an agent task tracker.",
        "properties": {
          "last_processed_event_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "The most recent processed event ID (omit to leave unchanged)",
            "title": "Last Processed Event Id"
          },
          "status": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Processing status",
            "title": "Status"
          },
          "status_reason": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Optional status reason",
            "title": "Status Reason"
          }
        },
        "title": "UpdateAgentTaskTrackerRequest",
        "type": "object"
      },
      "UpdateEnvRequest": {
        "description": "Request to update an environment (partial update).",
        "properties": {
          "branch_rules": {
            "anyOf": [
              {
                "items": {
                  "type": "string"
                },
                "minItems": 1,
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "description": "Branch patterns for matching",
            "title": "Branch Rules"
          }
        },
        "title": "UpdateEnvRequest",
        "type": "object"
      },
      "UpdateNamespaceRequest": {
        "description": "Request model for updating a namespace.\n\nInfrastructure fields (k8s_namespace, gcs_bucket, gcp_sa_email) are NOT\nexposed here — they are set exclusively by the provisioning workflow via\nthe repository layer.",
        "properties": {
          "name": {
            "anyOf": [
              {
                "maxLength": 255,
                "minLength": 1,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Human-readable name.",
            "title": "Name"
          }
        },
        "title": "UpdateNamespaceRequest",
        "type": "object"
      },
      "UpdateOrganizationMemberRequest": {
        "description": "Request model for updating organization member role.",
        "properties": {
          "role_slug": {
            "description": "Organization role slug for the target member",
            "enum": [
              "admin",
              "member"
            ],
            "title": "Role Slug",
            "type": "string"
          }
        },
        "required": [
          "role_slug"
        ],
        "title": "UpdateOrganizationMemberRequest",
        "type": "object"
      },
      "UpdateProjectRequest": {
        "description": "Request model for updating a project.",
        "properties": {
          "description": {
            "anyOf": [
              {
                "maxLength": 1000,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Optional project description.",
            "title": "Description"
          },
          "name": {
            "anyOf": [
              {
                "maxLength": 255,
                "minLength": 1,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Project name.",
            "title": "Name"
          }
        },
        "title": "UpdateProjectRequest",
        "type": "object"
      },
      "UpdateSpanRequest": {
        "properties": {
          "data": {
            "additionalProperties": true,
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "items": {
                  "additionalProperties": true,
                  "type": "object"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "description": "Any additional metadata or context for the span",
            "title": "Additional data associated with the span"
          },
          "end_time": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "The time the span ended",
            "title": "The end time of the span"
          },
          "input": {
            "additionalProperties": true,
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "items": {
                  "additionalProperties": true,
                  "type": "object"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "description": "Input parameters or data for the operation",
            "title": "The input data for the span"
          },
          "name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Name that describes what operation this span represents",
            "title": "The name of the span"
          },
          "output": {
            "additionalProperties": true,
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "items": {
                  "additionalProperties": true,
                  "type": "object"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "description": "Output data resulting from the operation",
            "title": "The output data from the span"
          },
          "parent_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "ID of the parent span if this is a child span in a trace",
            "title": "The parent span ID if this is a child span"
          },
          "start_time": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "The time the span started",
            "title": "The start time of the span"
          },
          "trace_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Unique identifier for the trace this span belongs to",
            "title": "The trace ID for this span"
          }
        },
        "title": "UpdateSpanRequest",
        "type": "object"
      },
      "UpdateStateRequest": {
        "properties": {
          "agent_id": {
            "title": "The unique id of the agent to update the state of",
            "type": "string"
          },
          "state": {
            "additionalProperties": true,
            "title": "The state to update the state with.",
            "type": "object"
          },
          "task_id": {
            "title": "The unique id of the task to update the state of",
            "type": "string"
          }
        },
        "required": [
          "task_id",
          "agent_id",
          "state"
        ],
        "title": "UpdateStateRequest",
        "type": "object"
      },
      "UpdateTaskRequest": {
        "properties": {
          "task_metadata": {
            "additionalProperties": true,
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "If provided, replaces task_metadata with this value"
          }
        },
        "title": "UpdateTaskRequest",
        "type": "object"
      },
      "UpsertProjectCollaboratorRequest": {
        "description": "Request model for setting/updating a project collaborator role.",
        "properties": {
          "role": {
            "description": "Role to assign.",
            "enum": [
              "discoverer",
              "viewer",
              "editor",
              "owner"
            ],
            "title": "Role",
            "type": "string"
          }
        },
        "required": [
          "role"
        ],
        "title": "UpsertProjectCollaboratorRequest",
        "type": "object"
      },
      "Usage": {
        "description": "Token usage statistics.",
        "properties": {
          "inputTokens": {
            "description": "Input tokens used",
            "title": "Inputtokens",
            "type": "integer"
          },
          "outputTokens": {
            "description": "Output tokens used",
            "title": "Outputtokens",
            "type": "integer"
          },
          "totalTokens": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "description": "Total tokens (input + output)",
            "title": "Totaltokens"
          }
        },
        "required": [
          "inputTokens",
          "outputTokens"
        ],
        "title": "Usage",
        "type": "object"
      },
      "ValidationError": {
        "properties": {
          "loc": {
            "items": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "integer"
                }
              ]
            },
            "title": "Location",
            "type": "array"
          },
          "msg": {
            "title": "Message",
            "type": "string"
          },
          "type": {
            "title": "Error Type",
            "type": "string"
          }
        },
        "required": [
          "loc",
          "msg",
          "type"
        ],
        "title": "ValidationError",
        "type": "object"
      },
      "VersionEventContent": {
        "description": "Typed content for version events stored as JSONB.",
        "properties": {
          "actor_email": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Email of the user who triggered this event",
            "title": "Actor Email"
          },
          "container_logs": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Best-effort container log snapshot for VERSION_FAILED events",
            "title": "Container Logs"
          },
          "container_logs_container_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Container name used when fetching container logs",
            "title": "Container Logs Container Name"
          },
          "container_logs_fetched_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "When the container logs snapshot was fetched",
            "title": "Container Logs Fetched At"
          },
          "container_logs_pod_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Pod name used when fetching container logs",
            "title": "Container Logs Pod Name"
          },
          "container_logs_source": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Which log source was used (current or previous)",
            "title": "Container Logs Source"
          },
          "container_logs_truncated": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "Whether container logs were truncated due to safety limits",
            "title": "Container Logs Truncated"
          },
          "container_logs_unavailable_reason": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Best-effort reason when container logs could not be fetched",
            "title": "Container Logs Unavailable Reason"
          },
          "error_message": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Error message for failure events",
            "title": "Error Message"
          },
          "failure_reason": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Classified failure reason (DeploymentFailureReason value) for VERSION_FAILED events",
            "title": "Failure Reason"
          },
          "from_version_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Version ID tasks were migrated FROM (for TASKS_MIGRATED events)",
            "title": "From Version Id"
          },
          "git_hash": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Git hash for context",
            "title": "Git Hash"
          },
          "migrated_task_count": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "description": "Number of tasks migrated (for TASKS_MIGRATED events)",
            "title": "Migrated Task Count"
          },
          "migrated_task_ids": {
            "anyOf": [
              {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "description": "Task IDs that were migrated (for TASKS_MIGRATED events)",
            "title": "Migrated Task Ids"
          },
          "new_status": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/VersionStatus"
              },
              {
                "type": "null"
              }
            ],
            "description": "Status after this event"
          },
          "previous_status": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/VersionStatus"
              },
              {
                "type": "null"
              }
            ],
            "description": "Status before this event"
          },
          "target_version_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Target version ID for rollback events",
            "title": "Target Version Id"
          },
          "triggered_by": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/VersionEventTrigger"
              },
              {
                "type": "null"
              }
            ],
            "description": "What triggered this event"
          }
        },
        "title": "VersionEventContent",
        "type": "object"
      },
      "VersionEventListResponse": {
        "description": "Response model for listing version events.",
        "properties": {
          "events": {
            "description": "List of version events",
            "items": {
              "$ref": "#/components/schemas/VersionEventResponse"
            },
            "title": "Events",
            "type": "array"
          },
          "has_more": {
            "description": "Whether there are more events after the last one",
            "title": "Has More",
            "type": "boolean"
          },
          "total": {
            "description": "Total number of events returned",
            "title": "Total",
            "type": "integer"
          }
        },
        "required": [
          "events",
          "total",
          "has_more"
        ],
        "title": "VersionEventListResponse",
        "type": "object"
      },
      "VersionEventResponse": {
        "description": "Response model for a single version event.",
        "properties": {
          "actor_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "User ID who triggered this event",
            "title": "Actor Id"
          },
          "branch_id": {
            "description": "Branch ID (denormalized)",
            "title": "Branch Id",
            "type": "string"
          },
          "content": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/VersionEventContent"
              },
              {
                "type": "null"
              }
            ],
            "description": "Event-specific metadata"
          },
          "created_at": {
            "description": "When this event was created",
            "format": "date-time",
            "title": "Created At",
            "type": "string"
          },
          "event_type": {
            "$ref": "#/components/schemas/VersionEventType",
            "description": "Type of lifecycle event"
          },
          "id": {
            "description": "Event ID",
            "title": "Id",
            "type": "string"
          },
          "sequence_id": {
            "description": "Monotonically increasing sequence ID for ordering",
            "title": "Sequence Id",
            "type": "integer"
          },
          "version_id": {
            "description": "Version ID this event belongs to",
            "title": "Version Id",
            "type": "string"
          }
        },
        "required": [
          "id",
          "sequence_id",
          "version_id",
          "branch_id",
          "event_type",
          "created_at"
        ],
        "title": "VersionEventResponse",
        "type": "object"
      },
      "VersionEventTrigger": {
        "description": "What triggered a version event.",
        "enum": [
          "deploy",
          "container_register",
          "rollback",
          "hot_swap",
          "helm_failure",
          "redeploy",
          "cleanup",
          "manual"
        ],
        "title": "VersionEventTrigger",
        "type": "string"
      },
      "VersionEventType": {
        "description": "Types of version lifecycle events.",
        "enum": [
          "VERSION_CREATED",
          "VERSION_ACTIVATED",
          "VERSION_FAILED",
          "VERSION_DRAINING",
          "VERSION_RETIRED",
          "VERSION_ROLLED_BACK_FROM",
          "VERSION_ROLLED_BACK_TO",
          "VERSION_REDEPLOYED",
          "TASKS_MIGRATED",
          "VERSION_CLEANUP_FAILED"
        ],
        "title": "VersionEventType",
        "type": "string"
      },
      "VersionListResponse": {
        "description": "Response for listing versions of a branch.",
        "properties": {
          "branch_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Branch ID",
            "title": "Branch Id"
          },
          "total": {
            "description": "Total count",
            "title": "Total",
            "type": "integer"
          },
          "versions": {
            "description": "List of versions",
            "items": {
              "$ref": "#/components/schemas/VersionResponse"
            },
            "title": "Versions",
            "type": "array"
          }
        },
        "required": [
          "versions",
          "total"
        ],
        "title": "VersionListResponse",
        "type": "object"
      },
      "VersionMetricsResponse": {
        "description": "Response model for version deployment metrics.",
        "properties": {
          "deployment_duration_p95_seconds": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "description": "P95 deployment duration in seconds for this version",
            "title": "Deployment Duration P95 Seconds"
          },
          "deployment_duration_seconds": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "description": "Average deployment duration in seconds for this version",
            "title": "Deployment Duration Seconds"
          }
        },
        "title": "VersionMetricsResponse",
        "type": "object"
      },
      "VersionPodLogEntry": {
        "description": "A single pod log entry returned for a deployment version.",
        "properties": {
          "agent_id": {
            "description": "Agent ID associated with this log",
            "title": "Agent Id",
            "type": "string"
          },
          "branch_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Branch ID associated with this log",
            "title": "Branch Id"
          },
          "cluster": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Cluster name",
            "title": "Cluster"
          },
          "container_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Container name",
            "title": "Container Name"
          },
          "k8s_namespace": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Kubernetes namespace containing the pod",
            "title": "K8S Namespace"
          },
          "log_id": {
            "description": "Stable pod log identifier for pagination",
            "title": "Log Id",
            "type": "string"
          },
          "message": {
            "description": "Pod log message",
            "title": "Message",
            "type": "string"
          },
          "pod_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Kubernetes pod name",
            "title": "Pod Name"
          },
          "stream": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Container log stream (stdout/stderr)",
            "title": "Stream"
          },
          "timestamp": {
            "description": "ISO 8601 log timestamp",
            "title": "Timestamp",
            "type": "string"
          },
          "version_id": {
            "description": "Version ID associated with this log",
            "title": "Version Id",
            "type": "string"
          }
        },
        "required": [
          "log_id",
          "timestamp",
          "version_id",
          "agent_id",
          "message"
        ],
        "title": "VersionPodLogEntry",
        "type": "object"
      },
      "VersionPodLogsResponse": {
        "description": "Paginated pod logs for a deployed version.",
        "properties": {
          "has_more": {
            "description": "Whether more matching logs exist beyond this page",
            "title": "Has More",
            "type": "boolean"
          },
          "logs": {
            "items": {
              "$ref": "#/components/schemas/VersionPodLogEntry"
            },
            "title": "Logs",
            "type": "array"
          },
          "total": {
            "description": "Total number of matching logs",
            "title": "Total",
            "type": "integer"
          }
        },
        "required": [
          "total",
          "has_more"
        ],
        "title": "VersionPodLogsResponse",
        "type": "object"
      },
      "VersionPodMetricsResponse": {
        "description": "Pod-level CPU + memory metrics for a deployed version (last N minutes).",
        "properties": {
          "cpu_cores": {
            "description": "CPU usage rate in cores (derived from container_cpu_usage_seconds_total)",
            "items": {
              "$ref": "#/components/schemas/TimeSeriesPoint"
            },
            "title": "Cpu Cores",
            "type": "array"
          },
          "k8s_namespace": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Kubernetes namespace containing the version pods",
            "title": "K8S Namespace"
          },
          "memory_working_set_bytes": {
            "description": "Memory working set in bytes (container_memory_working_set_bytes)",
            "items": {
              "$ref": "#/components/schemas/TimeSeriesPoint"
            },
            "title": "Memory Working Set Bytes",
            "type": "array"
          },
          "pod_name_prefix": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Pod name prefix (Helm release name) used for filtering",
            "title": "Pod Name Prefix"
          },
          "pods": {
            "description": "Pods observed in window",
            "items": {
              "type": "string"
            },
            "title": "Pods",
            "type": "array"
          },
          "step_seconds": {
            "description": "Bucket size in seconds",
            "title": "Step Seconds",
            "type": "integer"
          },
          "window_minutes": {
            "description": "Lookback window in minutes",
            "title": "Window Minutes",
            "type": "integer"
          }
        },
        "required": [
          "window_minutes",
          "step_seconds"
        ],
        "title": "VersionPodMetricsResponse",
        "type": "object"
      },
      "VersionResponse": {
        "description": "Full version details.",
        "properties": {
          "acp_type": {
            "$ref": "#/components/schemas/ACPType",
            "description": "Type of ACP server (sync or async)"
          },
          "author_email": {
            "description": "Commit author email",
            "title": "Author Email",
            "type": "string"
          },
          "author_name": {
            "description": "Commit author name",
            "title": "Author Name",
            "type": "string"
          },
          "branch_id": {
            "description": "Parent branch ID",
            "title": "Branch Id",
            "type": "string"
          },
          "created_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Creation timestamp",
            "title": "Created At"
          },
          "deployed_at": {
            "description": "When this version was deployed",
            "format": "date-time",
            "title": "Deployed At",
            "type": "string"
          },
          "failure_diagnostics": {
            "anyOf": [
              {
                "additionalProperties": {
                  "type": "string"
                },
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "description": "User-facing failure diagnostics with 'title', 'description', and 'action' fields",
            "title": "Failure Diagnostics"
          },
          "failure_reason": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Classified failure reason when status is FAILED (e.g., 'image_pull_failed', 'crash_loop', 'scheduling_failed')",
            "title": "Failure Reason"
          },
          "git_branch": {
            "description": "Git branch name",
            "title": "Git Branch",
            "type": "string"
          },
          "git_hash": {
            "description": "Git commit hash",
            "title": "Git Hash",
            "type": "string"
          },
          "git_message": {
            "default": "",
            "description": "Git commit message",
            "title": "Git Message",
            "type": "string"
          },
          "id": {
            "description": "Version ID",
            "title": "Id",
            "type": "string"
          },
          "image_expires_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "When image expires (for rollback window)",
            "title": "Image Expires At"
          },
          "image_url": {
            "description": "Container image URL",
            "title": "Image Url",
            "type": "string"
          },
          "is_dirty": {
            "default": false,
            "description": "Whether the commit had uncommitted changes",
            "title": "Is Dirty",
            "type": "boolean"
          },
          "last_rollback_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Timestamp when this version was last rolled back TO",
            "title": "Last Rollback At"
          },
          "replicas": {
            "default": 0,
            "description": "Current pod count for this version",
            "title": "Replicas",
            "type": "integer"
          },
          "retired_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "When version was retired",
            "title": "Retired At"
          },
          "rollback_count": {
            "default": 0,
            "description": "Number of rollbacks to this version",
            "title": "Rollback Count",
            "type": "integer"
          },
          "rolled_back_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Timestamp when this version was rolled back FROM",
            "title": "Rolled Back At"
          },
          "sdk_type": {
            "$ref": "#/components/schemas/SDKType",
            "description": "SDK type for agent runtime"
          },
          "source_filesystem_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Filesystem snapshot that can reopen this version in Agent Builder",
            "title": "Source Filesystem Id"
          },
          "status": {
            "$ref": "#/components/schemas/VersionStatus",
            "description": "Version lifecycle status"
          },
          "updated_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Last update timestamp",
            "title": "Updated At"
          }
        },
        "required": [
          "id",
          "branch_id",
          "git_hash",
          "git_branch",
          "author_name",
          "author_email",
          "image_url",
          "status",
          "deployed_at",
          "sdk_type",
          "acp_type"
        ],
        "title": "VersionResponse",
        "type": "object"
      },
      "VersionStatus": {
        "description": "Status of a version in its lifecycle.",
        "enum": [
          "DEPLOYING",
          "ACTIVE",
          "FAILED",
          "UNHEALTHY",
          "DRAINING",
          "RETIRED",
          "ROLLED_BACK"
        ],
        "title": "VersionStatus",
        "type": "string"
      },
      "VersionSummary": {
        "description": "Abbreviated version info for embedding in branch responses.",
        "properties": {
          "deployed_at": {
            "description": "When this version was deployed",
            "format": "date-time",
            "title": "Deployed At",
            "type": "string"
          },
          "git_hash": {
            "description": "Git commit hash",
            "title": "Git Hash",
            "type": "string"
          },
          "git_message": {
            "default": "",
            "description": "Git commit message",
            "title": "Git Message",
            "type": "string"
          },
          "id": {
            "description": "Version ID",
            "title": "Id",
            "type": "string"
          },
          "source_filesystem_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Filesystem snapshot that can reopen this version in Agent Builder",
            "title": "Source Filesystem Id"
          },
          "status": {
            "$ref": "#/components/schemas/VersionStatus",
            "description": "Version lifecycle status"
          }
        },
        "required": [
          "id",
          "git_hash",
          "status",
          "deployed_at"
        ],
        "title": "VersionSummary",
        "type": "object"
      }
    }
  },
  "info": {
    "title": "Sb0 API",
    "version": "0.1.0"
  },
  "openapi": "3.1.0",
  "paths": {
    "/agent_api_keys": {
      "get": {
        "description": "List API keys for an agent ID.",
        "operationId": "agent_api_keys_list",
        "parameters": [
          {
            "in": "query",
            "name": "agent_id",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Agent Id"
            }
          },
          {
            "in": "query",
            "name": "agent_name",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Agent Name"
            }
          },
          {
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "default": 50,
              "title": "Limit",
              "type": "integer"
            }
          },
          {
            "in": "query",
            "name": "page_number",
            "required": false,
            "schema": {
              "default": 1,
              "title": "Page Number",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/AgentAPIKey"
                  },
                  "title": "Response Agent Api Keys List",
                  "type": "array"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "List API keys for an agent ID",
        "tags": [
          "Agent APIKeys"
        ]
      },
      "post": {
        "operationId": "agent_api_keys_create",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateAPIKeyRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CreateAPIKeyResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Create Api Key",
        "tags": [
          "Agent APIKeys"
        ]
      }
    },
    "/agent_api_keys/name/{api_key_name}": {
      "delete": {
        "description": "Delete API key by name.",
        "operationId": "agent_api_keys_name_delete",
        "parameters": [
          {
            "in": "path",
            "name": "api_key_name",
            "required": true,
            "schema": {
              "title": "Api Key Name",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "agent_id",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Agent Id"
            }
          },
          {
            "in": "query",
            "name": "agent_name",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Agent Name"
            }
          },
          {
            "in": "query",
            "name": "api_key_type",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/AgentAPIKeyType",
              "default": "external"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "title": "Response Agent Api Keys Name Delete",
                  "type": "string"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Delete API key by name",
        "tags": [
          "Agent APIKeys"
        ]
      }
    },
    "/agent_api_keys/name/{name}": {
      "get": {
        "description": "Return named API key for the agent ID.",
        "operationId": "agent_api_keys_name_retrieve",
        "parameters": [
          {
            "in": "path",
            "name": "name",
            "required": true,
            "schema": {
              "title": "Name",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "agent_id",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Agent Id"
            }
          },
          {
            "in": "query",
            "name": "agent_name",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Agent Name"
            }
          },
          {
            "in": "query",
            "name": "api_key_type",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/AgentAPIKeyType",
              "default": "external"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AgentAPIKey"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Return named API key for the agent ID",
        "tags": [
          "Agent APIKeys"
        ]
      }
    },
    "/agent_api_keys/{id}": {
      "delete": {
        "description": "Delete API key by ID.",
        "operationId": "agent_api_keys_delete",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "title": "Id",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "title": "Response Agent Api Keys Delete",
                  "type": "string"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Delete API key by ID",
        "tags": [
          "Agent APIKeys"
        ]
      },
      "get": {
        "description": "Return API key by ID.",
        "operationId": "agent_api_keys_retrieve",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "title": "Id",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AgentAPIKey"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Return the API key by ID",
        "tags": [
          "Agent APIKeys"
        ]
      }
    },
    "/agents": {
      "get": {
        "description": "List all registered agents, optionally filtered by query parameters.",
        "operationId": "agents_list",
        "parameters": [
          {
            "description": "Task ID",
            "in": "query",
            "name": "task_id",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Task ID",
              "title": "Task Id"
            }
          },
          {
            "description": "Filter by namespace ID",
            "in": "query",
            "name": "namespace_id",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Filter by namespace ID",
              "title": "Namespace Id"
            }
          },
          {
            "description": "Limit",
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "default": 50,
              "description": "Limit",
              "minimum": 1,
              "title": "Limit",
              "type": "integer"
            }
          },
          {
            "description": "Page number",
            "in": "query",
            "name": "page_number",
            "required": false,
            "schema": {
              "default": 1,
              "description": "Page number",
              "minimum": 1,
              "title": "Page Number",
              "type": "integer"
            }
          },
          {
            "description": "Field to order by",
            "in": "query",
            "name": "order_by",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Field to order by",
              "title": "Order By"
            }
          },
          {
            "description": "Order direction (asc or desc)",
            "in": "query",
            "name": "order_direction",
            "required": false,
            "schema": {
              "default": "desc",
              "description": "Order direction (asc or desc)",
              "title": "Order Direction",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/AgentListItem"
                  },
                  "title": "Response Agents List",
                  "type": "array"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "List Agents",
        "tags": [
          "Agents"
        ]
      }
    },
    "/agents/deploy": {
      "post": {
        "description": "Deploy an agent to the platform.\n\n    Called by CLI after pushing the container image to the registry.\n    Creates or updates agent, branch, and version records.\n\n    The deployment is asynchronous - poll GET /branches/{branch_id}\n    for status updates until status is READY or FAILED.\n\n    **Flow:**\n    1. CLI builds and pushes image to registry (using /registry/auth)\n    2. CLI calls POST /agents/deploy with image details\n    3. Platform creates records and triggers K8s deployment\n    4. Container starts and calls POST /versions/register\n    5. CLI polls GET /branches/{id} for status",
        "operationId": "deploy",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DeployRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DeployResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Deploy Agent",
        "tags": [
          "Branches",
          "Agents"
        ],
        "x-fern-sdk-group-name": [
          "agents"
        ],
        "x-fern-sdk-method-name": "deploy"
      }
    },
    "/agents/forward/name/{namespace_slug}/{agent_name}/{path}": {
      "get": {
        "description": "Forward a GET request to an agent by namespace and name.",
        "operationId": "forward_get_request_to_agent_by_name",
        "parameters": [
          {
            "in": "path",
            "name": "namespace_slug",
            "required": true,
            "schema": {
              "title": "Namespace Slug",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "agent_name",
            "required": true,
            "schema": {
              "title": "Agent Name",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "path",
            "required": true,
            "schema": {
              "title": "Path",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Forward GET request to agent by name",
        "tags": [
          "Agents"
        ],
        "x-fern-sdk-group-name": [
          "agents"
        ],
        "x-fern-sdk-method-name": "forward_get_by_name"
      },
      "post": {
        "description": "Forward a POST request to an agent by namespace and name.",
        "operationId": "rpc_by_name",
        "parameters": [
          {
            "in": "path",
            "name": "namespace_slug",
            "required": true,
            "schema": {
              "title": "Namespace Slug",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "agent_name",
            "required": true,
            "schema": {
              "title": "Agent Name",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "path",
            "required": true,
            "schema": {
              "title": "Path",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Forward POST request to agent by name",
        "tags": [
          "Agents"
        ],
        "x-fern-sdk-group-name": [
          "agents"
        ],
        "x-fern-sdk-method-name": "rpc_by_name"
      }
    },
    "/agents/name/{namespace_slug}/{agent_name}": {
      "delete": {
        "description": "Delete an agent by namespace slug and agent name.",
        "operationId": "agents_delete_by_name",
        "parameters": [
          {
            "in": "path",
            "name": "namespace_slug",
            "required": true,
            "schema": {
              "title": "Namespace Slug",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "agent_name",
            "required": true,
            "schema": {
              "title": "Agent Name",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DeleteResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Delete Agent by Name",
        "tags": [
          "Agents"
        ]
      },
      "get": {
        "description": "Get an agent by namespace slug and agent name.",
        "operationId": "agents_retrieve_by_name",
        "parameters": [
          {
            "in": "path",
            "name": "namespace_slug",
            "required": true,
            "schema": {
              "title": "Namespace Slug",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "agent_name",
            "required": true,
            "schema": {
              "title": "Agent Name",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Agent"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Get Agent by Name",
        "tags": [
          "Agents"
        ],
        "x-fern-sdk-group-name": [
          "agents"
        ],
        "x-fern-sdk-method-name": "retrieve_by_name"
      }
    },
    "/agents/{agent_id}": {
      "delete": {
        "description": "Delete an agent by its unique ID.",
        "operationId": "agents_delete",
        "parameters": [
          {
            "in": "path",
            "name": "agent_id",
            "required": true,
            "schema": {
              "title": "Agent Id",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DeleteResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Delete Agent by ID",
        "tags": [
          "Agents"
        ]
      },
      "get": {
        "description": "Get an agent by its unique ID.",
        "operationId": "agents_retrieve",
        "parameters": [
          {
            "in": "path",
            "name": "agent_id",
            "required": true,
            "schema": {
              "title": "Agent Id",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Agent"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Get Agent by ID",
        "tags": [
          "Agents"
        ]
      }
    },
    "/agents/{agent_id}/metrics": {
      "get": {
        "description": "Get aggregated metrics for an agent over the last 24 hours. Includes task success rate, task count, error log count, and average task duration.",
        "operationId": "agents_retrieve_metrics",
        "parameters": [
          {
            "in": "path",
            "name": "agent_id",
            "required": true,
            "schema": {
              "title": "Agent Id",
              "type": "string"
            }
          },
          {
            "description": "Optional branch ID filter",
            "in": "query",
            "name": "branch_id",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Optional branch ID filter",
              "title": "Branch Id"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AgentMetricsResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Get Agent Metrics",
        "tags": [
          "Agents"
        ],
        "x-fern-sdk-group-name": [
          "agents"
        ],
        "x-fern-sdk-method-name": "retrieve_metrics"
      }
    },
    "/agents/{agent_id}/schedules": {
      "get": {
        "description": "List all schedules for an agent.",
        "operationId": "agents_schedules_list",
        "parameters": [
          {
            "in": "path",
            "name": "agent_id",
            "required": true,
            "schema": {
              "title": "Agent Id",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "page_size",
            "required": false,
            "schema": {
              "default": 100,
              "maximum": 1000,
              "minimum": 1,
              "title": "Page Size",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ScheduleListResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "List Agent Schedules",
        "tags": [
          "Schedules"
        ]
      },
      "post": {
        "description": "Create a new schedule for recurring workflow execution for an agent.",
        "operationId": "agents_schedules_create",
        "parameters": [
          {
            "in": "path",
            "name": "agent_id",
            "required": true,
            "schema": {
              "title": "Agent Id",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateScheduleRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ScheduleResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Create Schedule",
        "tags": [
          "Schedules"
        ]
      }
    },
    "/agents/{agent_id}/schedules/{schedule_name}": {
      "delete": {
        "description": "Delete a schedule permanently.",
        "operationId": "agents_schedules_delete",
        "parameters": [
          {
            "in": "path",
            "name": "schedule_name",
            "required": true,
            "schema": {
              "title": "Schedule Name",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "agent_id",
            "required": true,
            "schema": {
              "title": "Agent Id",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DeleteResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Delete Schedule",
        "tags": [
          "Schedules"
        ]
      },
      "get": {
        "description": "Get details of a schedule by its name.",
        "operationId": "agents_schedules_retrieve",
        "parameters": [
          {
            "in": "path",
            "name": "schedule_name",
            "required": true,
            "schema": {
              "title": "Schedule Name",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "agent_id",
            "required": true,
            "schema": {
              "title": "Agent Id",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ScheduleResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Get Schedule",
        "tags": [
          "Schedules"
        ]
      }
    },
    "/agents/{agent_id}/schedules/{schedule_name}/pause": {
      "post": {
        "description": "Pause a schedule to stop it from executing.",
        "operationId": "agents_schedules_pause",
        "parameters": [
          {
            "in": "path",
            "name": "schedule_name",
            "required": true,
            "schema": {
              "title": "Schedule Name",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "agent_id",
            "required": true,
            "schema": {
              "title": "Agent Id",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "anyOf": [
                  {
                    "$ref": "#/components/schemas/PauseScheduleRequest"
                  },
                  {
                    "type": "null"
                  }
                ],
                "title": "Request"
              }
            }
          }
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ScheduleResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Pause Schedule",
        "tags": [
          "Schedules"
        ]
      }
    },
    "/agents/{agent_id}/schedules/{schedule_name}/trigger": {
      "post": {
        "description": "Trigger a schedule to run immediately, regardless of its regular schedule.",
        "operationId": "agents_schedules_trigger",
        "parameters": [
          {
            "in": "path",
            "name": "schedule_name",
            "required": true,
            "schema": {
              "title": "Schedule Name",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "agent_id",
            "required": true,
            "schema": {
              "title": "Agent Id",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ScheduleResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Trigger Schedule",
        "tags": [
          "Schedules"
        ]
      }
    },
    "/agents/{agent_id}/schedules/{schedule_name}/unpause": {
      "post": {
        "description": "Unpause/resume a schedule to allow it to execute again.",
        "operationId": "agents_schedules_unpause",
        "parameters": [
          {
            "in": "path",
            "name": "schedule_name",
            "required": true,
            "schema": {
              "title": "Schedule Name",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "agent_id",
            "required": true,
            "schema": {
              "title": "Agent Id",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "anyOf": [
                  {
                    "$ref": "#/components/schemas/UnpauseScheduleRequest"
                  },
                  {
                    "type": "null"
                  }
                ],
                "title": "Request"
              }
            }
          }
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ScheduleResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Unpause Schedule",
        "tags": [
          "Schedules"
        ]
      }
    },
    "/agents/{namespace_slug}/{agent_name}/branch": {
      "get": {
        "description": "Get a specific branch by agent name and git branch.\n\n    The git branch name will be normalized (lowercased, slashes converted to hyphens).\n    For example, \"feature/new-tool\" becomes \"feature-new-tool\".",
        "operationId": "agents_branches_retrieve",
        "parameters": [
          {
            "in": "path",
            "name": "namespace_slug",
            "required": true,
            "schema": {
              "title": "Namespace Slug",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "agent_name",
            "required": true,
            "schema": {
              "title": "Agent Name",
              "type": "string"
            }
          },
          {
            "description": "Target branch (e.g., 'main', 'feature/login')",
            "in": "query",
            "name": "branch",
            "required": true,
            "schema": {
              "description": "Target branch (e.g., 'main', 'feature/login')",
              "title": "Branch",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BranchResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Get Branch by Agent and Git Branch",
        "tags": [
          "Branches"
        ],
        "x-fern-sdk-group-name": [
          "agents",
          "branches"
        ],
        "x-fern-sdk-method-name": "retrieve"
      }
    },
    "/agents/{namespace_slug}/{agent_name}/branches": {
      "get": {
        "description": "List all branches for an agent.\n\n    Each branch represents a git branch (e.g., main, staging, feature-x).\n    By default, retired branches are excluded.",
        "operationId": "agents_branches_list",
        "parameters": [
          {
            "in": "path",
            "name": "namespace_slug",
            "required": true,
            "schema": {
              "title": "Namespace Slug",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "agent_name",
            "required": true,
            "schema": {
              "title": "Agent Name",
              "type": "string"
            }
          },
          {
            "description": "Include retired branches in results",
            "in": "query",
            "name": "include_retired",
            "required": false,
            "schema": {
              "default": false,
              "description": "Include retired branches in results",
              "title": "Include Retired",
              "type": "boolean"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BranchListResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "List Branches by Agent",
        "tags": [
          "Branches"
        ],
        "x-fern-sdk-group-name": [
          "agents",
          "branches"
        ],
        "x-fern-sdk-method-name": "list"
      }
    },
    "/agents/{namespace_slug}/{agent_name}/branches/{branch}/rollback": {
      "post": {
        "description": "Roll back a branch to a previous version by namespace, agent, and git branch name.\n\n    Key behavior:\n    - EnvVar table is NOT modified (remains pending state)\n    - Uses Version.secrets_snapshot as deployed state",
        "operationId": "agents_branches_rollback",
        "parameters": [
          {
            "in": "path",
            "name": "namespace_slug",
            "required": true,
            "schema": {
              "title": "Namespace Slug",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "agent_name",
            "required": true,
            "schema": {
              "title": "Agent Name",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "branch",
            "required": true,
            "schema": {
              "title": "Branch",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RollbackRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RollbackResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Rollback Branch by Git Branch Name",
        "tags": [
          "Branches"
        ],
        "x-fern-sdk-group-name": [
          "agents",
          "branches"
        ],
        "x-fern-sdk-method-name": "rollback"
      }
    },
    "/agents/{namespace_slug}/{agent_name}/environments": {
      "get": {
        "description": "List all environments for an agent.\n\n    Environments define deployment targets (e.g., production, staging, preview).",
        "operationId": "agents_environments_list",
        "parameters": [
          {
            "in": "path",
            "name": "namespace_slug",
            "required": true,
            "schema": {
              "title": "Namespace Slug",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "agent_name",
            "required": true,
            "schema": {
              "title": "Agent Name",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EnvListResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "List Environments",
        "tags": [
          "Environments"
        ],
        "x-fern-sdk-group-name": [
          "agents",
          "environments"
        ],
        "x-fern-sdk-method-name": "list"
      },
      "post": {
        "description": "Create a new environment for an agent.\n\n    Environments define deployment targets with branch matching rules.\n    The is_prod flag cannot be set via API - production environment is protected.\n\n    **Branch Rules:**\n    - Exact match: [\"main\"] or [\"develop\"]\n    - Wildcard: [\"feature/*\"] matches feature/foo, feature/bar\n    - Catch-all: [\"*\"] matches any branch",
        "operationId": "agents_environments_create",
        "parameters": [
          {
            "in": "path",
            "name": "namespace_slug",
            "required": true,
            "schema": {
              "title": "Namespace Slug",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "agent_name",
            "required": true,
            "schema": {
              "title": "Agent Name",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateEnvRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EnvResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Create Environment",
        "tags": [
          "Environments"
        ],
        "x-fern-sdk-group-name": [
          "agents",
          "environments"
        ],
        "x-fern-sdk-method-name": "create"
      }
    },
    "/agents/{namespace_slug}/{agent_name}/environments/{env_name}": {
      "delete": {
        "description": "Delete an environment.\n\n    **Note:** Production environments (is_prod=True) cannot be deleted.",
        "operationId": "agents_environments_delete",
        "parameters": [
          {
            "in": "path",
            "name": "namespace_slug",
            "required": true,
            "schema": {
              "title": "Namespace Slug",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "agent_name",
            "required": true,
            "schema": {
              "title": "Agent Name",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "env_name",
            "required": true,
            "schema": {
              "title": "Env Name",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DeleteEnvResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Delete Environment",
        "tags": [
          "Environments"
        ],
        "x-fern-sdk-group-name": [
          "agents",
          "environments"
        ],
        "x-fern-sdk-method-name": "delete"
      },
      "get": {
        "description": "Get environment details by name.",
        "operationId": "agents_environments_retrieve",
        "parameters": [
          {
            "in": "path",
            "name": "namespace_slug",
            "required": true,
            "schema": {
              "title": "Namespace Slug",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "agent_name",
            "required": true,
            "schema": {
              "title": "Agent Name",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "env_name",
            "required": true,
            "schema": {
              "title": "Env Name",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EnvResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Get Environment",
        "tags": [
          "Environments"
        ],
        "x-fern-sdk-group-name": [
          "agents",
          "environments"
        ],
        "x-fern-sdk-method-name": "retrieve"
      },
      "put": {
        "description": "Update an existing environment.\n\n    All fields are optional - only provided fields will be updated.\n\n    **Production Environment Constraints:**\n    - branch_rules must be exactly one literal string (no wildcards)\n    - is_prod cannot be changed via API",
        "operationId": "agents_environments_update",
        "parameters": [
          {
            "in": "path",
            "name": "namespace_slug",
            "required": true,
            "schema": {
              "title": "Namespace Slug",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "agent_name",
            "required": true,
            "schema": {
              "title": "Agent Name",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "env_name",
            "required": true,
            "schema": {
              "title": "Env Name",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateEnvRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EnvResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Update Environment",
        "tags": [
          "Environments"
        ],
        "x-fern-sdk-group-name": [
          "agents",
          "environments"
        ],
        "x-fern-sdk-method-name": "update"
      }
    },
    "/agents/{namespace_slug}/{agent_name}/environments/{env_name}/branches": {
      "get": {
        "description": "List all branches that match this environment's branch rules.\n\n    For wildcard environments (like preview with [\"*\"]),\n    returns all non-retired branches for the agent.\n\n    For specific branch rules (like production with [\"main\"]),\n    returns only the matching branch(es).\n\n    Branches are sorted by updated_at descending (most recent first).",
        "operationId": "agents_environments_branches_list",
        "parameters": [
          {
            "in": "path",
            "name": "namespace_slug",
            "required": true,
            "schema": {
              "title": "Namespace Slug",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "agent_name",
            "required": true,
            "schema": {
              "title": "Agent Name",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "env_name",
            "required": true,
            "schema": {
              "title": "Env Name",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BranchListResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "List Branches for Environment",
        "tags": [
          "Environments"
        ],
        "x-fern-sdk-group-name": [
          "agents",
          "environments",
          "branches"
        ],
        "x-fern-sdk-method-name": "list"
      }
    },
    "/agents/{namespace_slug}/{agent_name}/environments/{env_name}/rollback": {
      "post": {
        "description": "Roll back an environment to a previous version.\n\n    Resolves environment to branch via branch rules.\n    Only works for environments with a single, literal branch rule (no wildcards).\n\n    Key behavior:\n    - EnvVar table is NOT modified (remains pending state for next deploy)\n    - Uses Version.secrets_snapshot as deployed state",
        "operationId": "agents_environments_rollback_create",
        "parameters": [
          {
            "in": "path",
            "name": "namespace_slug",
            "required": true,
            "schema": {
              "title": "Namespace Slug",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "agent_name",
            "required": true,
            "schema": {
              "title": "Agent Name",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "env_name",
            "required": true,
            "schema": {
              "title": "Env Name",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RollbackRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RollbackResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Rollback Environment",
        "tags": [
          "Branches"
        ]
      }
    },
    "/agents/{namespace_slug}/{agent_name}/environments/{env_name}/secrets": {
      "get": {
        "description": "List PENDING secrets for an environment (from EnvVar table).\n\n    This is what will be used on next deploy.\n    For deployed state, use GET /agents/{namespace_slug}/{agent_name}/environments/{env}/secrets/deployed\n\n    Note: is_secret=True values are NEVER returned, only non-secrets when include_values=True.",
        "operationId": "agents_environments_secrets_list",
        "parameters": [
          {
            "in": "path",
            "name": "namespace_slug",
            "required": true,
            "schema": {
              "title": "Namespace Slug",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "agent_name",
            "required": true,
            "schema": {
              "title": "Agent Name",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "env_name",
            "required": true,
            "schema": {
              "title": "Env Name",
              "type": "string"
            }
          },
          {
            "description": "Include values for non-secrets (is_secret=False only)",
            "in": "query",
            "name": "include_values",
            "required": false,
            "schema": {
              "default": false,
              "description": "Include values for non-secrets (is_secret=False only)",
              "title": "Include Values",
              "type": "boolean"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EnvVarListResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "List Pending Secrets for Environment",
        "tags": [
          "Secrets"
        ],
        "x-fern-sdk-group-name": [
          "agents",
          "environments",
          "secrets"
        ],
        "x-fern-sdk-method-name": "list"
      },
      "put": {
        "description": "Set one or more secrets/config values.\n\n    If redeploy=True (default) and environment has active deployment,\n    triggers redeploy with same image but new secrets_snapshot.",
        "operationId": "agents_environments_secrets_set",
        "parameters": [
          {
            "in": "path",
            "name": "namespace_slug",
            "required": true,
            "schema": {
              "title": "Namespace Slug",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "agent_name",
            "required": true,
            "schema": {
              "title": "Agent Name",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "env_name",
            "required": true,
            "schema": {
              "title": "Env Name",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SetEnvVarRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SetEnvVarResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Set Secrets",
        "tags": [
          "Secrets"
        ],
        "x-fern-sdk-group-name": [
          "agents",
          "environments",
          "secrets"
        ],
        "x-fern-sdk-method-name": "set"
      }
    },
    "/agents/{namespace_slug}/{agent_name}/environments/{env_name}/secrets/deployed": {
      "get": {
        "description": "List DEPLOYED secrets for an environment (from Version.secrets_snapshot).\n\n    This is what's currently running. May differ from pending state after rollback.\n    Only returns keys, never actual values.",
        "operationId": "agents_environments_secrets_list_deployed",
        "parameters": [
          {
            "in": "path",
            "name": "namespace_slug",
            "required": true,
            "schema": {
              "title": "Namespace Slug",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "agent_name",
            "required": true,
            "schema": {
              "title": "Agent Name",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "env_name",
            "required": true,
            "schema": {
              "title": "Env Name",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DeployedSecretsResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "List Deployed Secrets for Environment",
        "tags": [
          "Secrets"
        ],
        "x-fern-sdk-group-name": [
          "agents",
          "environments",
          "secrets"
        ],
        "x-fern-sdk-method-name": "list_deployed"
      }
    },
    "/agents/{namespace_slug}/{agent_name}/environments/{env_name}/secrets/{key}": {
      "delete": {
        "description": "Delete a secret from an environment.\n\n    If redeploy=True (default), triggers redeploy with updated secrets.",
        "operationId": "agents_environments_secrets_delete",
        "parameters": [
          {
            "in": "path",
            "name": "namespace_slug",
            "required": true,
            "schema": {
              "title": "Namespace Slug",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "agent_name",
            "required": true,
            "schema": {
              "title": "Agent Name",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "env_name",
            "required": true,
            "schema": {
              "title": "Env Name",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "key",
            "required": true,
            "schema": {
              "title": "Key",
              "type": "string"
            }
          },
          {
            "description": "If true, trigger redeploy after deletion",
            "in": "query",
            "name": "redeploy",
            "required": false,
            "schema": {
              "default": true,
              "description": "If true, trigger redeploy after deletion",
              "title": "Redeploy",
              "type": "boolean"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DeleteEnvVarResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Delete Secret",
        "tags": [
          "Secrets"
        ],
        "x-fern-sdk-group-name": [
          "agents",
          "environments",
          "secrets"
        ],
        "x-fern-sdk-method-name": "delete"
      }
    },
    "/agents/{namespace_slug}/{agent_name}/resolve-env": {
      "get": {
        "description": "Resolve which environment matches a given branch.\n\n    Uses specificity-based matching:\n    - Exact match wins over wildcards (e.g., \"main\" matches production before preview)\n    - Prefix wildcards match by length (e.g., \"feature/*\" beats \"*\")\n    - Catch-all \"*\" has lowest priority\n\n    Returns 404 if no environment matches the branch.",
        "operationId": "agents_resolve_env",
        "parameters": [
          {
            "in": "path",
            "name": "namespace_slug",
            "required": true,
            "schema": {
              "title": "Namespace Slug",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "agent_name",
            "required": true,
            "schema": {
              "title": "Agent Name",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "branch",
            "required": true,
            "schema": {
              "title": "Branch",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ResolveEnvResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Resolve Environment for Branch",
        "tags": [
          "Environments"
        ],
        "x-fern-sdk-group-name": [
          "agents",
          "environments"
        ],
        "x-fern-sdk-method-name": "resolve_env"
      }
    },
    "/agents/{namespace_slug}/{agent_name}/secrets": {
      "get": {
        "description": "Cross-environment view of all secrets for an agent.\n\n    Shows which keys exist in which environments.\n    Never returns actual secret values (is_secret=True).\n    Values for non-secrets only returned when include_values=True.",
        "operationId": "agents_secrets_list",
        "parameters": [
          {
            "in": "path",
            "name": "namespace_slug",
            "required": true,
            "schema": {
              "title": "Namespace Slug",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "agent_name",
            "required": true,
            "schema": {
              "title": "Agent Name",
              "type": "string"
            }
          },
          {
            "description": "Include values for non-secrets (is_secret=False only)",
            "in": "query",
            "name": "include_values",
            "required": false,
            "schema": {
              "default": false,
              "description": "Include values for non-secrets (is_secret=False only)",
              "title": "Include Values",
              "type": "boolean"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CrossEnvSecretsListResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "List Secrets Across Environments",
        "tags": [
          "Secrets"
        ],
        "x-fern-sdk-group-name": [
          "agents",
          "secrets"
        ],
        "x-fern-sdk-method-name": "list"
      }
    },
    "/agents/{namespace_slug}/{agent_name}/versions": {
      "get": {
        "description": "List all versions for an agent.\n\n    Optionally filter by branch name or version status.\n    Versions are ordered by deployed_at descending (most recent first).",
        "operationId": "agents_list_versions",
        "parameters": [
          {
            "in": "path",
            "name": "namespace_slug",
            "required": true,
            "schema": {
              "title": "Namespace Slug",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "agent_name",
            "required": true,
            "schema": {
              "title": "Agent Name",
              "type": "string"
            }
          },
          {
            "description": "Filter by branch name (e.g., 'main', 'feature/login'). If not provided, returns versions across all branches.",
            "in": "query",
            "name": "branch",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Filter by branch name (e.g., 'main', 'feature/login'). If not provided, returns versions across all branches.",
              "title": "Branch"
            }
          },
          {
            "description": "Filter by version status",
            "in": "query",
            "name": "status",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "$ref": "#/components/schemas/VersionStatus"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Filter by version status",
              "title": "Status"
            }
          },
          {
            "description": "Maximum versions to return",
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "default": 20,
              "description": "Maximum versions to return",
              "maximum": 100,
              "minimum": 1,
              "title": "Limit",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VersionListResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "List Versions for Agent",
        "tags": [
          "Agents"
        ],
        "x-fern-sdk-group-name": [
          "agents",
          "versions"
        ],
        "x-fern-sdk-method-name": "list"
      }
    },
    "/api_keys": {
      "get": {
        "description": "List all API keys for the organization. Only org admins can list keys.",
        "operationId": "api_keys_list",
        "parameters": [
          {
            "in": "query",
            "name": "include_revoked",
            "required": false,
            "schema": {
              "default": false,
              "title": "Include Revoked",
              "type": "boolean"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiKeyListResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "List API Keys",
        "tags": [
          "API Keys"
        ]
      },
      "post": {
        "description": "Create a new org-level API key. Only org admins can create API keys.",
        "operationId": "api_keys_create",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ApiKeyCreateRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiKeyCreateResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Create API Key",
        "tags": [
          "API Keys"
        ]
      }
    },
    "/api_keys/{api_key_id}": {
      "delete": {
        "description": "Revoke an API key. Only org admins can revoke keys.",
        "operationId": "api_keys_delete",
        "parameters": [
          {
            "in": "path",
            "name": "api_key_id",
            "required": true,
            "schema": {
              "title": "Api Key Id",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DeleteResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Revoke API Key",
        "tags": [
          "API Keys"
        ]
      },
      "get": {
        "description": "Get details of a specific API key. Only org admins can view keys.",
        "operationId": "api_keys_retrieve",
        "parameters": [
          {
            "in": "path",
            "name": "api_key_id",
            "required": true,
            "schema": {
              "title": "Api Key Id",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiKeyResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Get API Key",
        "tags": [
          "API Keys"
        ]
      },
      "patch": {
        "description": "Update scopes for an API key. Only org admins can update key scopes.",
        "operationId": "api_keys_update_scopes",
        "parameters": [
          {
            "in": "path",
            "name": "api_key_id",
            "required": true,
            "schema": {
              "title": "Api Key Id",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ApiKeyScopesUpdateRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiKeyResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Update API Key Scopes",
        "tags": [
          "API Keys"
        ]
      }
    },
    "/api_keys/{api_key_id}/sharing-groups": {
      "patch": {
        "description": "Update default sharing groups for resources created by an API key.",
        "operationId": "api_keys_update_sharing_groups",
        "parameters": [
          {
            "in": "path",
            "name": "api_key_id",
            "required": true,
            "schema": {
              "title": "Api Key Id",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ApiKeySharingGroupsUpdateRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiKeyResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Update API Key Sharing Groups",
        "tags": [
          "API Keys"
        ]
      }
    },
    "/branches/{branch_id}": {
      "get": {
        "description": "Get branch details by ID.\n\n    Used by CLI to poll for branch status after calling POST /agents/deploy.\n    Poll until status is READY (success) or FAILED/TIMEOUT (failure).",
        "operationId": "branches_retrieve",
        "parameters": [
          {
            "in": "path",
            "name": "branch_id",
            "required": true,
            "schema": {
              "title": "Branch Id",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BranchResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Get Branch",
        "tags": [
          "Branches"
        ],
        "x-fern-sdk-group-name": [
          "branches"
        ],
        "x-fern-sdk-method-name": "retrieve"
      }
    },
    "/branches/{branch_id}/events": {
      "get": {
        "description": "List lifecycle events across all versions for a branch.",
        "operationId": "branches_events_list",
        "parameters": [
          {
            "in": "path",
            "name": "branch_id",
            "required": true,
            "schema": {
              "title": "Branch Id",
              "type": "string"
            }
          },
          {
            "description": "Filter by event type",
            "in": "query",
            "name": "event_type",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "$ref": "#/components/schemas/VersionEventType"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Filter by event type",
              "title": "Event Type"
            }
          },
          {
            "description": "Return events after this sequence_id (for ascending pagination)",
            "in": "query",
            "name": "after_sequence_id",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "integer"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Return events after this sequence_id (for ascending pagination)",
              "title": "After Sequence Id"
            }
          },
          {
            "description": "Return events before this sequence_id (for descending pagination)",
            "in": "query",
            "name": "before_sequence_id",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "integer"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Return events before this sequence_id (for descending pagination)",
              "title": "Before Sequence Id"
            }
          },
          {
            "description": "Maximum events to return",
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "default": 50,
              "description": "Maximum events to return",
              "maximum": 100,
              "minimum": 1,
              "title": "Limit",
              "type": "integer"
            }
          },
          {
            "description": "Order by sequence_id descending (newest first)",
            "in": "query",
            "name": "descending",
            "required": false,
            "schema": {
              "default": true,
              "description": "Order by sequence_id descending (newest first)",
              "title": "Descending",
              "type": "boolean"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VersionEventListResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "List Branch Events",
        "tags": [
          "Branch Events"
        ],
        "x-fern-sdk-group-name": [
          "branches",
          "events"
        ],
        "x-fern-sdk-method-name": "list"
      }
    },
    "/branches/{branch_id}/redeploy": {
      "post": {
        "description": "Redeploy a branch with the current secrets from the EnvVar table.\n\n    Creates a new Version with:\n    - Same image as current version\n    - Fresh secrets_snapshot from current EnvVars\n\n    Use this after updating secrets to apply them to a running branch.",
        "operationId": "branches_redeploy",
        "parameters": [
          {
            "in": "path",
            "name": "branch_id",
            "required": true,
            "schema": {
              "title": "Branch Id",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RedeployResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Redeploy with Updated Secrets",
        "tags": [
          "Branches"
        ]
      }
    },
    "/branches/{branch_id}/rollback": {
      "post": {
        "description": "Roll back a branch to a previous version by branch ID.\n\n    Key behavior:\n    - EnvVar table is NOT modified (remains pending state)\n    - Uses Version.secrets_snapshot as deployed state",
        "operationId": "branches_rollback",
        "parameters": [
          {
            "in": "path",
            "name": "branch_id",
            "required": true,
            "schema": {
              "title": "Branch Id",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RollbackRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RollbackResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Rollback Branch",
        "tags": [
          "Branches"
        ],
        "x-fern-sdk-group-name": [
          "branches"
        ],
        "x-fern-sdk-method-name": "rollback"
      }
    },
    "/branches/{branch_id}/versions": {
      "get": {
        "description": "List all versions for a branch.\n\n    Versions are ordered by deployed_at descending (most recent first).\n    Each version represents a git commit that was deployed.",
        "operationId": "branches_versions_list",
        "parameters": [
          {
            "in": "path",
            "name": "branch_id",
            "required": true,
            "schema": {
              "title": "Branch Id",
              "type": "string"
            }
          },
          {
            "description": "Maximum versions to return",
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "default": 20,
              "description": "Maximum versions to return",
              "maximum": 100,
              "minimum": 1,
              "title": "Limit",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VersionListResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "List Versions",
        "tags": [
          "Branches"
        ],
        "x-fern-sdk-group-name": [
          "branches",
          "versions"
        ],
        "x-fern-sdk-method-name": "list"
      }
    },
    "/builds/prepare": {
      "post": {
        "description": "Return a presigned URL for uploading a build context archive to GCS.",
        "operationId": "builds_prepare",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BuildPrepareRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BuildPrepareResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Prepare Remote Build Upload",
        "tags": [
          "Builds"
        ]
      }
    },
    "/builds/submit": {
      "post": {
        "description": "Submit a Cloud Build build for an uploaded build context archive.",
        "operationId": "builds_submit",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BuildSubmitRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BuildSubmitResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Submit Remote Build",
        "tags": [
          "Builds"
        ]
      }
    },
    "/builds/{build_id}": {
      "get": {
        "description": "Get build status for a Cloud Build build ID (proxied).",
        "operationId": "builds_retrieve",
        "parameters": [
          {
            "in": "path",
            "name": "build_id",
            "required": true,
            "schema": {
              "title": "Build Id",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BuildStatusResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Get Remote Build Status",
        "tags": [
          "Builds"
        ]
      }
    },
    "/events": {
      "get": {
        "description": "List events for a specific task and agent.\n\nOptionally filter for events after a specific sequence ID.\nResults are ordered by sequence_id.",
        "operationId": "events_list",
        "parameters": [
          {
            "description": "Optional event ID to get events after this ID",
            "in": "query",
            "name": "last_processed_event_id",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Optional event ID to get events after this ID",
              "title": "Last Processed Event Id"
            }
          },
          {
            "description": "Optional limit on number of results",
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "maximum": 1000,
                  "minimum": 1,
                  "type": "integer"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Optional limit on number of results",
              "title": "Limit"
            }
          },
          {
            "description": "The task ID",
            "in": "query",
            "name": "task_id",
            "required": true,
            "schema": {
              "description": "The task ID",
              "title": "Task Id",
              "type": "string"
            }
          },
          {
            "description": "The agent ID",
            "in": "query",
            "name": "agent_id",
            "required": true,
            "schema": {
              "description": "The agent ID",
              "title": "Agent Id",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/Event"
                  },
                  "title": "Response Events List",
                  "type": "array"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "List Events",
        "tags": [
          "Events"
        ]
      }
    },
    "/events/{event_id}": {
      "get": {
        "operationId": "events_retrieve",
        "parameters": [
          {
            "in": "path",
            "name": "event_id",
            "required": true,
            "schema": {
              "title": "Event Id",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Event"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Get Event",
        "tags": [
          "Events"
        ]
      }
    },
    "/filesystems": {
      "get": {
        "description": "List all filesystems accessible to the current user.",
        "operationId": "filesystems_list",
        "parameters": [
          {
            "description": "Optional project filter. When provided, requires read access to the project and returns only filesystems in that project.",
            "in": "query",
            "name": "project_id",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Optional project filter. When provided, requires read access to the project and returns only filesystems in that project.",
              "title": "Project Id"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/FilesystemResponse"
                  },
                  "title": "Response Filesystems List",
                  "type": "array"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "List Filesystems",
        "tags": [
          "Filesystems"
        ]
      },
      "post": {
        "description": "Create a new filesystem linked to a project.",
        "operationId": "filesystems_create",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/FilesystemCreate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FilesystemResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Create Filesystem",
        "tags": [
          "Filesystems"
        ]
      }
    },
    "/filesystems/{filesystem_id}": {
      "get": {
        "description": "Get filesystem details by ID.",
        "operationId": "filesystems_retrieve",
        "parameters": [
          {
            "in": "path",
            "name": "filesystem_id",
            "required": true,
            "schema": {
              "title": "Filesystem Id",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FilesystemResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Get Filesystem",
        "tags": [
          "Filesystems"
        ]
      }
    },
    "/filesystems/{filesystem_id}/download-url": {
      "post": {
        "description": "Get a presigned URL for direct download from GCS.",
        "operationId": "filesystems_get_download_url",
        "parameters": [
          {
            "in": "path",
            "name": "filesystem_id",
            "required": true,
            "schema": {
              "title": "Filesystem Id",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "anyOf": [
                  {
                    "$ref": "#/components/schemas/PresignedUrlRequest"
                  },
                  {
                    "type": "null"
                  }
                ],
                "title": "Request"
              }
            }
          }
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PresignedUrlResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Get Download URL",
        "tags": [
          "Filesystems"
        ]
      }
    },
    "/filesystems/{filesystem_id}/file-download": {
      "get": {
        "description": "Download a single file from the filesystem.",
        "operationId": "filesystems_download_file",
        "parameters": [
          {
            "in": "path",
            "name": "filesystem_id",
            "required": true,
            "schema": {
              "title": "Filesystem Id",
              "type": "string"
            }
          },
          {
            "description": "Relative file path to download.",
            "in": "query",
            "name": "path",
            "required": true,
            "schema": {
              "description": "Relative file path to download.",
              "title": "Path",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/octet-stream": {
                "schema": {
                  "format": "binary",
                  "type": "string"
                }
              }
            },
            "description": "Binary file content"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Download File",
        "tags": [
          "Filesystems"
        ]
      }
    },
    "/filesystems/{filesystem_id}/file-upload": {
      "put": {
        "description": "Upload a single file into a filesystem by relative path. Defaults to overwrite mode; conditional mode can be used for strict concurrency control.",
        "operationId": "filesystems_upload_file",
        "parameters": [
          {
            "in": "path",
            "name": "filesystem_id",
            "required": true,
            "schema": {
              "title": "Filesystem Id",
              "type": "string"
            }
          },
          {
            "description": "Relative path to write.",
            "in": "query",
            "name": "path",
            "required": true,
            "schema": {
              "description": "Relative path to write.",
              "title": "Path",
              "type": "string"
            },
            "x-fern-parameter-name": "path"
          },
          {
            "description": "Upload semantics: overwrite (default) or conditional.",
            "in": "query",
            "name": "writeMode",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/FileUploadWriteMode",
              "default": "overwrite",
              "description": "Upload semantics: overwrite (default) or conditional."
            },
            "x-fern-parameter-name": "write_mode"
          },
          {
            "description": "Required in conditional mode: expected current archive version.",
            "in": "query",
            "name": "baseVersion",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Required in conditional mode: expected current archive version.",
              "title": "Baseversion"
            },
            "x-fern-parameter-name": "base_version"
          },
          {
            "description": "Conditional replace precondition on current file version.",
            "in": "query",
            "name": "expectedVersion",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Conditional replace precondition on current file version.",
              "title": "Expectedversion"
            },
            "x-fern-parameter-name": "expected_version"
          },
          {
            "description": "Conditional create precondition; must be '*'.",
            "in": "query",
            "name": "createOnly",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Conditional create precondition; must be '*'.",
              "title": "Createonly"
            },
            "x-fern-parameter-name": "create_only"
          },
          {
            "description": "Optional digest in format sha-256=<base64>.",
            "in": "query",
            "name": "digest",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Optional digest in format sha-256=<base64>.",
              "title": "Digest"
            },
            "x-fern-parameter-name": "digest"
          },
          {
            "description": "Optional idempotency key for safe retries.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Optional idempotency key for safe retries.",
              "title": "Idempotency-Key"
            },
            "x-fern-parameter-name": "idempotency_key"
          }
        ],
        "requestBody": {
          "content": {
            "application/octet-stream": {
              "schema": {
                "format": "binary",
                "title": "Body",
                "type": "string"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "archive_version": "a9502c997a...",
                  "created": false,
                  "file_version": "d4f9678f0c...",
                  "filesystem_id": "fs_123",
                  "path": "src/main.py",
                  "size_bytes": 14,
                  "write_mode": "overwrite"
                },
                "schema": {
                  "$ref": "#/components/schemas/SingleFileUploadResponse"
                }
              }
            },
            "description": "File replaced"
          },
          "201": {
            "content": {
              "application/json": {
                "example": {
                  "archive_version": "c7e8441b20...",
                  "created": true,
                  "file_version": "6a1d5c3f11...",
                  "filesystem_id": "fs_123",
                  "path": "notes/todo.txt",
                  "size_bytes": 23,
                  "write_mode": "conditional"
                },
                "schema": {
                  "$ref": "#/components/schemas/SingleFileUploadResponse"
                }
              }
            },
            "description": "File created"
          },
          "400": {
            "description": "Invalid path, write mode, or digest"
          },
          "404": {
            "description": "Filesystem not found"
          },
          "409": {
            "content": {
              "application/json": {
                "example": {
                  "code": 409,
                  "message": "baseVersion does not match current archive version."
                }
              }
            },
            "description": "Conflict (stale base version or idempotency conflict)"
          },
          "412": {
            "content": {
              "application/json": {
                "example": {
                  "code": 412,
                  "message": "expectedVersion does not match current file version."
                }
              }
            },
            "description": "Precondition failed for conditional upload"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          },
          "428": {
            "content": {
              "application/json": {
                "example": {
                  "code": 428,
                  "message": "baseVersion is required in conditional mode."
                }
              }
            },
            "description": "Conditional upload missing required preconditions"
          }
        },
        "summary": "Upload File",
        "tags": [
          "Filesystems"
        ],
        "x-fern-idempotent": true
      }
    },
    "/filesystems/{filesystem_id}/files": {
      "get": {
        "description": "List files in the filesystem manifest with optional filtering.",
        "operationId": "filesystems_list_files",
        "parameters": [
          {
            "in": "path",
            "name": "filesystem_id",
            "required": true,
            "schema": {
              "title": "Filesystem Id",
              "type": "string"
            }
          },
          {
            "description": "Directory prefix to filter results",
            "in": "query",
            "name": "directory",
            "required": false,
            "schema": {
              "default": "/",
              "description": "Directory prefix to filter results",
              "title": "Directory",
              "type": "string"
            }
          },
          {
            "description": "Include subdirectories",
            "in": "query",
            "name": "recursive",
            "required": false,
            "schema": {
              "default": true,
              "description": "Include subdirectories",
              "title": "Recursive",
              "type": "boolean"
            }
          },
          {
            "description": "Filter by MIME type",
            "in": "query",
            "name": "mime_type",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Filter by MIME type",
              "title": "Mime Type"
            }
          },
          {
            "description": "Include file content in response",
            "in": "query",
            "name": "include_content",
            "required": false,
            "schema": {
              "default": true,
              "description": "Include file content in response",
              "title": "Include Content",
              "type": "boolean"
            }
          },
          {
            "description": "Maximum number of results",
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "default": 1000,
              "description": "Maximum number of results",
              "maximum": 5000,
              "minimum": 1,
              "title": "Limit",
              "type": "integer"
            }
          },
          {
            "description": "Pagination offset",
            "in": "query",
            "name": "offset",
            "required": false,
            "schema": {
              "default": 0,
              "description": "Pagination offset",
              "minimum": 0,
              "title": "Offset",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ListFilesResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "List Files",
        "tags": [
          "Filesystems"
        ]
      }
    },
    "/filesystems/{filesystem_id}/files/{file_path}": {
      "get": {
        "description": "Retrieve a specific file (or directory) from the filesystem manifest.",
        "operationId": "filesystems_get_file",
        "parameters": [
          {
            "in": "path",
            "name": "filesystem_id",
            "required": true,
            "schema": {
              "title": "Filesystem Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "file_path",
            "required": true,
            "schema": {
              "title": "File Path",
              "type": "string"
            }
          },
          {
            "description": "Include file content in response",
            "in": "query",
            "name": "include_content",
            "required": false,
            "schema": {
              "default": true,
              "description": "Include file content in response",
              "title": "Include Content",
              "type": "boolean"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FilesystemFileResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Get File",
        "tags": [
          "Filesystems"
        ]
      }
    },
    "/filesystems/{filesystem_id}/sync-complete": {
      "post": {
        "description": "Notify that a sync operation completed and provide the file manifest.",
        "operationId": "filesystems_sync_complete",
        "parameters": [
          {
            "in": "path",
            "name": "filesystem_id",
            "required": true,
            "schema": {
              "title": "Filesystem Id",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SyncCompleteRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SyncCompleteResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Complete Sync Operation",
        "tags": [
          "Filesystems"
        ]
      }
    },
    "/filesystems/{filesystem_id}/upload-url": {
      "post": {
        "description": "Get a presigned URL for direct upload to GCS.",
        "operationId": "filesystems_get_upload_url",
        "parameters": [
          {
            "in": "path",
            "name": "filesystem_id",
            "required": true,
            "schema": {
              "title": "Filesystem Id",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "anyOf": [
                  {
                    "$ref": "#/components/schemas/PresignedUrlRequest"
                  },
                  {
                    "type": "null"
                  }
                ],
                "title": "Request"
              }
            }
          }
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PresignedUrlResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Get Upload URL",
        "tags": [
          "Filesystems"
        ]
      }
    },
    "/groups": {
      "get": {
        "description": "List groups visible to the current principal.",
        "operationId": "groups_list",
        "parameters": [
          {
            "description": "Optional owner org filter.",
            "in": "query",
            "name": "owner_org_id",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Optional owner org filter.",
              "title": "Owner Org Id"
            }
          },
          {
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "default": 50,
              "maximum": 200,
              "minimum": 1,
              "title": "Limit",
              "type": "integer"
            }
          },
          {
            "in": "query",
            "name": "page_number",
            "required": false,
            "schema": {
              "default": 1,
              "minimum": 1,
              "title": "Page Number",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AccessGroupListResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "List Groups",
        "tags": [
          "Groups"
        ]
      },
      "post": {
        "description": "Create an org-owned access group.",
        "operationId": "groups_create",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateAccessGroupRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AccessGroup"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Create Group",
        "tags": [
          "Groups"
        ]
      }
    },
    "/groups/{group_id}": {
      "delete": {
        "description": "Delete an access group.",
        "operationId": "groups_delete",
        "parameters": [
          {
            "in": "path",
            "name": "group_id",
            "required": true,
            "schema": {
              "title": "Group Id",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DeleteResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Delete Group",
        "tags": [
          "Groups"
        ]
      },
      "get": {
        "description": "Get group details.",
        "operationId": "groups_retrieve",
        "parameters": [
          {
            "in": "path",
            "name": "group_id",
            "required": true,
            "schema": {
              "title": "Group Id",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AccessGroup"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Get Group",
        "tags": [
          "Groups"
        ]
      },
      "patch": {
        "description": "Update group metadata.",
        "operationId": "groups_update",
        "parameters": [
          {
            "in": "path",
            "name": "group_id",
            "required": true,
            "schema": {
              "title": "Group Id",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateAccessGroupRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AccessGroup"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Update Group",
        "tags": [
          "Groups"
        ]
      }
    },
    "/groups/{group_id}/managers": {
      "get": {
        "operationId": "groups_managers_list",
        "parameters": [
          {
            "in": "path",
            "name": "group_id",
            "required": true,
            "schema": {
              "title": "Group Id",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AccessGroupManagersResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "List Group Managers",
        "tags": [
          "Groups"
        ]
      }
    },
    "/groups/{group_id}/managers/{member_id}": {
      "delete": {
        "operationId": "groups_managers_delete",
        "parameters": [
          {
            "in": "path",
            "name": "group_id",
            "required": true,
            "schema": {
              "title": "Group Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "member_id",
            "required": true,
            "schema": {
              "title": "Member Id",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DeleteResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Remove Group Manager",
        "tags": [
          "Groups"
        ]
      },
      "put": {
        "operationId": "groups_managers_upsert",
        "parameters": [
          {
            "in": "path",
            "name": "group_id",
            "required": true,
            "schema": {
              "title": "Group Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "member_id",
            "required": true,
            "schema": {
              "title": "Member Id",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AccessGroupManager"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Add Group Manager",
        "tags": [
          "Groups"
        ]
      }
    },
    "/groups/{group_id}/members": {
      "get": {
        "operationId": "groups_members_list",
        "parameters": [
          {
            "in": "path",
            "name": "group_id",
            "required": true,
            "schema": {
              "title": "Group Id",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AccessGroupMembersResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "List Group Members",
        "tags": [
          "Groups"
        ]
      }
    },
    "/groups/{group_id}/members/{member_id}": {
      "delete": {
        "operationId": "groups_members_delete",
        "parameters": [
          {
            "in": "path",
            "name": "group_id",
            "required": true,
            "schema": {
              "title": "Group Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "member_id",
            "required": true,
            "schema": {
              "title": "Member Id",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DeleteResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Remove Group Member",
        "tags": [
          "Groups"
        ]
      },
      "put": {
        "operationId": "groups_members_upsert",
        "parameters": [
          {
            "in": "path",
            "name": "group_id",
            "required": true,
            "schema": {
              "title": "Group Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "member_id",
            "required": true,
            "schema": {
              "title": "Member Id",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AccessGroupMember"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Add Group Member",
        "tags": [
          "Groups"
        ]
      }
    },
    "/groups/{group_id}/visible-orgs": {
      "get": {
        "operationId": "groups_visible_orgs_list",
        "parameters": [
          {
            "in": "path",
            "name": "group_id",
            "required": true,
            "schema": {
              "title": "Group Id",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AccessGroupVisibleOrgsResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "List Group Visible Orgs",
        "tags": [
          "Groups"
        ]
      }
    },
    "/groups/{group_id}/visible-orgs/{org_id}": {
      "delete": {
        "operationId": "groups_visible_orgs_delete",
        "parameters": [
          {
            "in": "path",
            "name": "group_id",
            "required": true,
            "schema": {
              "title": "Group Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "org_id",
            "required": true,
            "schema": {
              "title": "Org Id",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DeleteResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Remove Group Visible Org",
        "tags": [
          "Groups"
        ]
      },
      "put": {
        "operationId": "groups_visible_orgs_upsert",
        "parameters": [
          {
            "in": "path",
            "name": "group_id",
            "required": true,
            "schema": {
              "title": "Group Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "org_id",
            "required": true,
            "schema": {
              "title": "Org Id",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AccessGroupVisibleOrg"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Add Group Visible Org",
        "tags": [
          "Groups"
        ]
      }
    },
    "/logs": {
      "get": {
        "description": "Query logs for an agent. Requires user authentication.",
        "operationId": "logs_list",
        "parameters": [
          {
            "description": "Name of the agent (format: namespace/name or agent ID)",
            "in": "query",
            "name": "agent_name",
            "required": true,
            "schema": {
              "description": "Name of the agent (format: namespace/name or agent ID)",
              "title": "Agent Name",
              "type": "string"
            }
          },
          {
            "description": "Filter by branch/deployment ID",
            "in": "query",
            "name": "branch_id",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Filter by branch/deployment ID",
              "title": "Branch Id"
            }
          },
          {
            "description": "Filter by task ID",
            "in": "query",
            "name": "task_id",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Filter by task ID",
              "title": "Task Id"
            }
          },
          {
            "description": "Filter by OTEL trace ID (32 lowercase hex chars)",
            "in": "query",
            "name": "trace_id",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "maxLength": 32,
                  "minLength": 32,
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Filter by OTEL trace ID (32 lowercase hex chars)",
              "title": "Trace Id"
            }
          },
          {
            "description": "Filter by log level",
            "in": "query",
            "name": "level",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "$ref": "#/components/schemas/LogLevel"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Filter by log level",
              "title": "Level"
            }
          },
          {
            "description": "Filter by source (stdout, stderr, server)",
            "in": "query",
            "name": "source",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "$ref": "#/components/schemas/LogSource"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Filter by source (stdout, stderr, server)",
              "title": "Source"
            }
          },
          {
            "description": "Start timestamp filter (ISO 8601)",
            "in": "query",
            "name": "since",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "format": "date-time",
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Start timestamp filter (ISO 8601)",
              "title": "Since"
            }
          },
          {
            "description": "End timestamp filter (ISO 8601)",
            "in": "query",
            "name": "until",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "format": "date-time",
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "End timestamp filter (ISO 8601)",
              "title": "Until"
            }
          },
          {
            "description": "Full-text search in message (case-insensitive)",
            "in": "query",
            "name": "search",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "maxLength": 500,
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Full-text search in message (case-insensitive)",
              "title": "Search"
            }
          },
          {
            "description": "Return logs after this log_id (cursor-based pagination)",
            "in": "query",
            "name": "after_id",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Return logs after this log_id (cursor-based pagination)",
              "title": "After Id"
            }
          },
          {
            "description": "Maximum number of results",
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "default": 100,
              "description": "Maximum number of results",
              "maximum": 1000,
              "minimum": 1,
              "title": "Limit",
              "type": "integer"
            }
          },
          {
            "description": "Number of results to skip",
            "in": "query",
            "name": "offset",
            "required": false,
            "schema": {
              "default": 0,
              "description": "Number of results to skip",
              "maximum": 10000,
              "minimum": 0,
              "title": "Offset",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LogListResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "List Agent Logs",
        "tags": [
          "Logs"
        ]
      }
    },
    "/logs/otlp": {
      "post": {
        "description": "Ingest OpenTelemetry logs from an agent. Requires agent API key authentication.",
        "operationId": "logs_ingest_otlp",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/OTLPLogIngestionRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OTLPLogIngestionResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Ingest Agent Logs (OTLP Format)",
        "tags": [
          "Logs"
        ]
      }
    },
    "/logs/stream": {
      "get": {
        "description": "Stream logs for an agent in real-time using Server-Sent Events (SSE). Emits multiple event types (connected, log, error) discriminated by 'type' field. Only streams NEW logs after connection (like tail -f). Auto-disconnects after 5 minutes for cost control.",
        "operationId": "logs_stream",
        "parameters": [
          {
            "description": "Name of the agent (format: namespace/name or agent ID)",
            "in": "query",
            "name": "agent_name",
            "required": true,
            "schema": {
              "description": "Name of the agent (format: namespace/name or agent ID)",
              "title": "Agent Name",
              "type": "string"
            }
          },
          {
            "description": "Filter by task ID",
            "in": "query",
            "name": "task_id",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Filter by task ID",
              "title": "Task Id"
            }
          },
          {
            "description": "Minimum log level",
            "in": "query",
            "name": "level",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "$ref": "#/components/schemas/LogLevel"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Minimum log level",
              "title": "Level"
            }
          },
          {
            "description": "Filter by source (stdout, stderr, server)",
            "in": "query",
            "name": "source",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "$ref": "#/components/schemas/LogSource"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Filter by source (stdout, stderr, server)",
              "title": "Source"
            }
          },
          {
            "description": "Filter by branch/version ID",
            "in": "query",
            "name": "branch_id",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Filter by branch/version ID",
              "title": "Branch Id"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LogStreamEvent"
                }
              },
              "text/event-stream": {
                "schema": {
                  "$ref": "#/components/schemas/LogStreamEvent"
                }
              }
            },
            "description": "SSE stream of log events"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Stream Agent Logs",
        "tags": [
          "Logs"
        ],
        "x-fern-sdk-group-name": [
          "logs"
        ],
        "x-fern-sdk-method-name": "stream",
        "x-fern-streaming": {
          "format": "sse"
        }
      }
    },
    "/namespaces": {
      "get": {
        "description": "List all namespaces the user has access to, optionally filtered by org.",
        "operationId": "namespaces_list",
        "parameters": [
          {
            "description": "Filter by owner organization ID",
            "in": "query",
            "name": "org_id",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Filter by owner organization ID",
              "title": "Org Id"
            }
          },
          {
            "description": "Maximum number of results",
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "default": 50,
              "description": "Maximum number of results",
              "maximum": 100,
              "minimum": 1,
              "title": "Limit",
              "type": "integer"
            }
          },
          {
            "description": "Page number",
            "in": "query",
            "name": "page_number",
            "required": false,
            "schema": {
              "default": 1,
              "description": "Page number",
              "minimum": 1,
              "title": "Page Number",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/Namespace"
                  },
                  "title": "Response Namespaces List",
                  "type": "array"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "List Namespaces",
        "tags": [
          "Namespaces"
        ]
      },
      "post": {
        "description": "Create a new namespace for multi-tenant isolation.",
        "operationId": "namespaces_create",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateNamespaceRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Namespace"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Create Namespace",
        "tags": [
          "Namespaces"
        ]
      }
    },
    "/namespaces/slug-availability/{slug}": {
      "get": {
        "description": "Check if a namespace slug is available for use.",
        "operationId": "namespaces_check_slug_availability",
        "parameters": [
          {
            "in": "path",
            "name": "slug",
            "required": true,
            "schema": {
              "title": "Slug",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SlugAvailabilityResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Check Slug Availability",
        "tags": [
          "Namespaces"
        ]
      }
    },
    "/namespaces/slug/{slug}": {
      "get": {
        "description": "Get a namespace by its slug.",
        "operationId": "namespaces_retrieve_by_slug",
        "parameters": [
          {
            "in": "path",
            "name": "slug",
            "required": true,
            "schema": {
              "title": "Slug",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Namespace"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Get Namespace by Slug",
        "tags": [
          "Namespaces"
        ]
      }
    },
    "/namespaces/{namespace_id}": {
      "delete": {
        "description": "Delete a namespace (must be empty).",
        "operationId": "namespaces_delete",
        "parameters": [
          {
            "in": "path",
            "name": "namespace_id",
            "required": true,
            "schema": {
              "title": "Namespace Id",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DeleteResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Delete Namespace",
        "tags": [
          "Namespaces"
        ]
      },
      "get": {
        "description": "Get a namespace by ID.",
        "operationId": "namespaces_retrieve",
        "parameters": [
          {
            "in": "path",
            "name": "namespace_id",
            "required": true,
            "schema": {
              "title": "Namespace Id",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Namespace"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Get Namespace",
        "tags": [
          "Namespaces"
        ]
      },
      "patch": {
        "description": "Update a namespace's properties.",
        "operationId": "namespaces_update",
        "parameters": [
          {
            "in": "path",
            "name": "namespace_id",
            "required": true,
            "schema": {
              "title": "Namespace Id",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateNamespaceRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Namespace"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Update Namespace",
        "tags": [
          "Namespaces"
        ]
      }
    },
    "/namespaces/{namespace_id}/retry-provisioning": {
      "post": {
        "description": "Retry provisioning for a namespace that failed or is stuck.",
        "operationId": "namespaces_retry_provisioning",
        "parameters": [
          {
            "in": "path",
            "name": "namespace_id",
            "required": true,
            "schema": {
              "title": "Namespace Id",
              "type": "string"
            }
          },
          {
            "description": "Force retry even if status is PENDING (for stuck namespaces)",
            "in": "query",
            "name": "force",
            "required": false,
            "schema": {
              "default": false,
              "description": "Force retry even if status is PENDING (for stuck namespaces)",
              "title": "Force",
              "type": "boolean"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Namespace"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Retry Namespace Provisioning",
        "tags": [
          "Namespaces"
        ]
      }
    },
    "/projects": {
      "get": {
        "description": "List all projects the user has access to.",
        "operationId": "projects_list",
        "parameters": [
          {
            "description": "Filter by namespace ID",
            "in": "query",
            "name": "namespace_id",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Filter by namespace ID",
              "title": "Namespace Id"
            }
          },
          {
            "description": "Maximum number of results",
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "default": 50,
              "description": "Maximum number of results",
              "maximum": 100,
              "minimum": 1,
              "title": "Limit",
              "type": "integer"
            }
          },
          {
            "description": "Page number",
            "in": "query",
            "name": "page_number",
            "required": false,
            "schema": {
              "default": 1,
              "description": "Page number",
              "minimum": 1,
              "title": "Page Number",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/ProjectListItem"
                  },
                  "title": "Response Projects List",
                  "type": "array"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "List Projects",
        "tags": [
          "Projects"
        ]
      },
      "post": {
        "description": "Create a new project within a namespace.",
        "operationId": "projects_create",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateProjectRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Project"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Create Project",
        "tags": [
          "Projects"
        ]
      }
    },
    "/projects/{project_id}": {
      "delete": {
        "description": "Delete a project (must be empty).",
        "operationId": "projects_delete",
        "parameters": [
          {
            "in": "path",
            "name": "project_id",
            "required": true,
            "schema": {
              "title": "Project Id",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DeleteResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Delete Project",
        "tags": [
          "Projects"
        ]
      },
      "get": {
        "description": "Get a project by ID.",
        "operationId": "projects_retrieve",
        "parameters": [
          {
            "in": "path",
            "name": "project_id",
            "required": true,
            "schema": {
              "title": "Project Id",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Project"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Get Project",
        "tags": [
          "Projects"
        ]
      },
      "patch": {
        "description": "Update a project's properties.",
        "operationId": "projects_update",
        "parameters": [
          {
            "in": "path",
            "name": "project_id",
            "required": true,
            "schema": {
              "title": "Project Id",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateProjectRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Project"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Update Project",
        "tags": [
          "Projects"
        ]
      }
    },
    "/projects/{project_id}/collaborators": {
      "get": {
        "description": "List explicit collaborator roles on a project.",
        "operationId": "projects_list_collaborators",
        "parameters": [
          {
            "in": "path",
            "name": "project_id",
            "required": true,
            "schema": {
              "title": "Project Id",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProjectCollaboratorsResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "List Project Collaborators",
        "tags": [
          "Projects"
        ]
      }
    },
    "/projects/{project_id}/collaborators/{member_id}": {
      "delete": {
        "description": "Remove explicit collaborator role tuples from a project.",
        "operationId": "projects_remove_collaborator",
        "parameters": [
          {
            "in": "path",
            "name": "project_id",
            "required": true,
            "schema": {
              "title": "Project Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "member_id",
            "required": true,
            "schema": {
              "title": "Member Id",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DeleteResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Remove Project Collaborator",
        "tags": [
          "Projects"
        ]
      },
      "put": {
        "description": "Create or update an explicit collaborator role on a project.",
        "operationId": "projects_upsert_collaborator",
        "parameters": [
          {
            "in": "path",
            "name": "project_id",
            "required": true,
            "schema": {
              "title": "Project Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "member_id",
            "required": true,
            "schema": {
              "title": "Member Id",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpsertProjectCollaboratorRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProjectCollaboratorResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Set Project Collaborator Role",
        "tags": [
          "Projects"
        ]
      }
    },
    "/raw-events": {
      "post": {
        "description": "Publish a raw SDK event for transformation and streaming.\n\n    This endpoint replaces the deprecated `/stream-events` endpoint.\n    Events are transformed via SDK-specific adapters (based on `sdk_type` and `sdk_version`)\n    and the resulting stream parts are published to Redis for real-time consumption.\n\n    Messages that should be stored (e.g., AssistantMessage, UserMessage) are\n    automatically persisted to MongoDB for later retrieval.\n\n    **Supported SDK Types:**\n    - `claude`: Claude Agent SDK messages (StreamEvent, AssistantMessage, etc.)\n    - `codex`: Codex SDK thread events (`item.*`, `turn.*`, `thread.*`)\n    - `terminal_use`: Direct UIMessage format (Vercel-compatible)\n\n    **What gets stored:**\n    - AssistantMessage, UserMessage, ResultMessage, SystemMessage\n\n    **What does NOT get stored:**\n    - StreamEvent (ephemeral streaming deltas)\n\n    Requires `update` permission on the task.",
        "operationId": "publish_raw_event_raw_events_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RawEventPayload"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublishRawEventResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Publish Raw SDK Event",
        "tags": [
          "Raw Events"
        ],
        "x-fern-retries": {
          "disabled": true
        }
      }
    },
    "/registry/auth": {
      "get": {
        "description": "Get short-lived credentials for pushing images to a namespace's registry.\n\n    Each namespace has its own isolated registry repository. The token returned\n    can ONLY push images to the specified namespace's repository.\n\n    The CLI uses this endpoint to authenticate with Docker before pushing\n    agent images. Returns a token valid for approximately 1 hour.\n\n    **Usage with Docker:**\n    ```bash\n    docker login {registry_url} -u {username} -p {token}\n    docker push {registry_url}/{repository}/{agent}:{tag}\n    ```",
        "operationId": "registry_auth",
        "parameters": [
          {
            "description": "Target namespace slug for the image push",
            "in": "query",
            "name": "namespace",
            "required": true,
            "schema": {
              "description": "Target namespace slug for the image push",
              "examples": [
                "acme",
                "my-org"
              ],
              "title": "Namespace",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RegistryAuthResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Get registry credentials for pushing agent images",
        "tags": [
          "Registry"
        ]
      }
    },
    "/search": {
      "get": {
        "description": "Unified search endpoint for agents, tasks, and workspaces.\n\n    Searches by name using case-insensitive matching.\n    Results are sorted by relevance (exact matches first, then prefix matches, then contains).",
        "operationId": "search",
        "parameters": [
          {
            "description": "Search query (minimum 2 characters)",
            "in": "query",
            "name": "q",
            "required": true,
            "schema": {
              "description": "Search query (minimum 2 characters)",
              "minLength": 2,
              "title": "Q",
              "type": "string"
            }
          },
          {
            "description": "Comma-separated list of types to search (agents,tasks,workspaces). If not provided, searches all types.",
            "in": "query",
            "name": "types",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Comma-separated list of types to search (agents,tasks,workspaces). If not provided, searches all types.",
              "title": "Types"
            }
          },
          {
            "description": "Optional namespace ID to filter results",
            "in": "query",
            "name": "namespace_id",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Optional namespace ID to filter results",
              "title": "Namespace Id"
            }
          },
          {
            "description": "Maximum number of results per type (max 50)",
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "default": 10,
              "description": "Maximum number of results per type (max 50)",
              "maximum": 50,
              "minimum": 1,
              "title": "Limit",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SearchResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Search Resources",
        "tags": [
          "Search"
        ]
      }
    },
    "/states": {
      "get": {
        "description": "List all states, filtered by task_id or agent_id (at least one required).",
        "operationId": "states_list",
        "parameters": [
          {
            "description": "Task ID",
            "in": "query",
            "name": "task_id",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Task ID",
              "title": "Task Id"
            }
          },
          {
            "description": "Agent ID",
            "in": "query",
            "name": "agent_id",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Agent ID",
              "title": "Agent Id"
            }
          },
          {
            "description": "Limit",
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "default": 50,
              "description": "Limit",
              "minimum": 1,
              "title": "Limit",
              "type": "integer"
            }
          },
          {
            "description": "Page number",
            "in": "query",
            "name": "page_number",
            "required": false,
            "schema": {
              "default": 1,
              "description": "Page number",
              "minimum": 1,
              "title": "Page Number",
              "type": "integer"
            }
          },
          {
            "description": "Field to order by",
            "in": "query",
            "name": "order_by",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Field to order by",
              "title": "Order By"
            }
          },
          {
            "description": "Order direction (asc or desc)",
            "in": "query",
            "name": "order_direction",
            "required": false,
            "schema": {
              "default": "desc",
              "description": "Order direction (asc or desc)",
              "title": "Order Direction",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/State"
                  },
                  "title": "Response States List",
                  "type": "array"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "List States",
        "tags": [
          "States"
        ]
      },
      "post": {
        "operationId": "states_create",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateStateRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/State"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Create Task State",
        "tags": [
          "States"
        ]
      }
    },
    "/states/{state_id}": {
      "delete": {
        "operationId": "states_delete",
        "parameters": [
          {
            "in": "path",
            "name": "state_id",
            "required": true,
            "schema": {
              "title": "State Id",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/State"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Delete Task State",
        "tags": [
          "States"
        ]
      },
      "get": {
        "description": "Get a state by its unique state ID.",
        "operationId": "states_retrieve",
        "parameters": [
          {
            "in": "path",
            "name": "state_id",
            "required": true,
            "schema": {
              "title": "State Id",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/State"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Get State by State ID",
        "tags": [
          "States"
        ]
      },
      "put": {
        "operationId": "states_update",
        "parameters": [
          {
            "in": "path",
            "name": "state_id",
            "required": true,
            "schema": {
              "title": "State Id",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateStateRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/State"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Update Task State",
        "tags": [
          "States"
        ]
      }
    },
    "/tasks": {
      "get": {
        "description": "List all tasks.",
        "operationId": "tasks_list",
        "parameters": [
          {
            "description": "Optional agent filter. When provided, we authorize it via direct OpenFGA Check and avoid ListObjects(agent) to prevent false 403s from transient/partial list results.",
            "in": "query",
            "name": "agent_id",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Optional agent filter. When provided, we authorize it via direct OpenFGA Check and avoid ListObjects(agent) to prevent false 403s from transient/partial list results.",
              "title": "Agent Id"
            }
          },
          {
            "in": "query",
            "name": "namespace_id",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Namespace Id"
            }
          },
          {
            "in": "query",
            "name": "agent_name",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Agent Name"
            }
          },
          {
            "in": "query",
            "name": "branch_id",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Branch Id"
            }
          },
          {
            "in": "query",
            "name": "status",
            "required": false,
            "schema": {
              "items": {
                "$ref": "#/components/schemas/TaskStatus"
              },
              "title": "Status",
              "type": "array"
            }
          },
          {
            "in": "query",
            "name": "created_after",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "format": "date-time",
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Created After"
            }
          },
          {
            "in": "query",
            "name": "created_before",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "format": "date-time",
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Created Before"
            }
          },
          {
            "in": "query",
            "name": "include_total",
            "required": false,
            "schema": {
              "default": false,
              "title": "Include Total",
              "type": "boolean"
            }
          },
          {
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "default": 50,
              "title": "Limit",
              "type": "integer"
            }
          },
          {
            "in": "query",
            "name": "page_number",
            "required": false,
            "schema": {
              "default": 1,
              "title": "Page Number",
              "type": "integer"
            }
          },
          {
            "in": "query",
            "name": "order_by",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Order By"
            }
          },
          {
            "in": "query",
            "name": "order_direction",
            "required": false,
            "schema": {
              "default": "desc",
              "title": "Order Direction",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "relationships",
            "required": false,
            "schema": {
              "items": {
                "$ref": "#/components/schemas/TaskRelationships"
              },
              "title": "Relationships",
              "type": "array"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/TaskResponse"
                  },
                  "title": "Response Tasks List",
                  "type": "array"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "List Tasks",
        "tags": [
          "Tasks"
        ]
      },
      "post": {
        "description": "Create a new task for an agent.",
        "operationId": "tasks_create",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateTaskRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TaskResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Create Task",
        "tags": [
          "Tasks"
        ]
      }
    },
    "/tasks/migrate": {
      "post": {
        "description": "Migrate tasks between versions within the same branch. Supports two modes: bulk migration by source version (from_version_id), or migration of specific tasks (task_ids). Target can be explicit (to_version_id) or latest active version (to_latest).",
        "operationId": "tasks_migrate",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MigrateTasksRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MigrateTasksResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Migrate Tasks Between Versions",
        "tags": [
          "Tasks"
        ]
      }
    },
    "/tasks/name/{task_name}": {
      "delete": {
        "description": "Delete a task by its unique name.",
        "operationId": "tasks_delete_by_name",
        "parameters": [
          {
            "in": "path",
            "name": "task_name",
            "required": true,
            "schema": {
              "title": "Task Name",
              "type": "string"
            }
          },
          {
            "description": "Optional agent filter. When provided, we authorize it via direct OpenFGA Check and avoid ListObjects(agent) to prevent false 403s from transient/partial list results.",
            "in": "query",
            "name": "agent_id",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Optional agent filter. When provided, we authorize it via direct OpenFGA Check and avoid ListObjects(agent) to prevent false 403s from transient/partial list results.",
              "title": "Agent Id"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DeleteResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Delete Task by Name",
        "tags": [
          "Tasks"
        ]
      },
      "get": {
        "description": "Get a task by its unique name.",
        "operationId": "tasks_retrieve_by_name",
        "parameters": [
          {
            "in": "path",
            "name": "task_name",
            "required": true,
            "schema": {
              "title": "Task Name",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "relationships",
            "required": false,
            "schema": {
              "items": {
                "$ref": "#/components/schemas/TaskRelationships"
              },
              "title": "Relationships",
              "type": "array"
            }
          },
          {
            "description": "Optional agent filter. When provided, we authorize it via direct OpenFGA Check and avoid ListObjects(agent) to prevent false 403s from transient/partial list results.",
            "in": "query",
            "name": "agent_id",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Optional agent filter. When provided, we authorize it via direct OpenFGA Check and avoid ListObjects(agent) to prevent false 403s from transient/partial list results.",
              "title": "Agent Id"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TaskResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Get Task by Name",
        "tags": [
          "Tasks"
        ]
      },
      "put": {
        "description": "Update mutable fields for a task by its unique Name.",
        "operationId": "tasks_update_by_name",
        "parameters": [
          {
            "in": "path",
            "name": "task_name",
            "required": true,
            "schema": {
              "title": "Task Name",
              "type": "string"
            }
          },
          {
            "description": "Optional agent filter. When provided, we authorize it via direct OpenFGA Check and avoid ListObjects(agent) to prevent false 403s from transient/partial list results.",
            "in": "query",
            "name": "agent_id",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Optional agent filter. When provided, we authorize it via direct OpenFGA Check and avoid ListObjects(agent) to prevent false 403s from transient/partial list results.",
              "title": "Agent Id"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateTaskRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Task"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Update Task by Name",
        "tags": [
          "Tasks"
        ]
      }
    },
    "/tasks/name/{task_name}/stream": {
      "get": {
        "description": "Stream events for a task by its unique name using Server-Sent Events (SSE).\n\n    Supports automatic reconnection with Last-Event-ID header. When the client\n    reconnects, it sends the Last-Event-ID header with the last received event ID,\n    and the server resumes from that point.\n\n    Returns TextStreamPart events (Vercel AI SDK compatible format).",
        "operationId": "tasks_stream_by_name",
        "parameters": [
          {
            "in": "path",
            "name": "task_name",
            "required": true,
            "schema": {
              "title": "Task Name",
              "type": "string"
            }
          },
          {
            "description": "Optional agent filter. When provided, we authorize it via direct OpenFGA Check and avoid ListObjects(agent) to prevent false 403s from transient/partial list results.",
            "in": "query",
            "name": "agent_id",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Optional agent filter. When provided, we authorize it via direct OpenFGA Check and avoid ListObjects(agent) to prevent false 403s from transient/partial list results.",
              "title": "Agent Id"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TextStreamPartWrapper"
                }
              }
            },
            "description": "SSE stream of TextStreamPart events"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Stream Task Events by Name",
        "tags": [
          "Tasks"
        ],
        "x-fern-streaming": {
          "format": "sse"
        }
      }
    },
    "/tasks/{task_id}": {
      "delete": {
        "description": "Delete a task by its unique ID.",
        "operationId": "tasks_delete",
        "parameters": [
          {
            "in": "path",
            "name": "task_id",
            "required": true,
            "schema": {
              "title": "Task Id",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DeleteResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Delete Task by ID",
        "tags": [
          "Tasks"
        ]
      },
      "get": {
        "description": "Get a task by its unique ID.",
        "operationId": "tasks_retrieve",
        "parameters": [
          {
            "in": "path",
            "name": "task_id",
            "required": true,
            "schema": {
              "title": "Task Id",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "relationships",
            "required": false,
            "schema": {
              "items": {
                "$ref": "#/components/schemas/TaskRelationships"
              },
              "title": "Relationships",
              "type": "array"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TaskResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Get Task by ID",
        "tags": [
          "Tasks"
        ]
      },
      "put": {
        "description": "Update mutable fields for a task by its unique ID.",
        "operationId": "tasks_update",
        "parameters": [
          {
            "in": "path",
            "name": "task_id",
            "required": true,
            "schema": {
              "title": "Task Id",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateTaskRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Task"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Update Task by ID",
        "tags": [
          "Tasks"
        ]
      }
    },
    "/tasks/{task_id}/cancel": {
      "post": {
        "description": "Cancel a running task.",
        "operationId": "tasks_cancel",
        "parameters": [
          {
            "in": "path",
            "name": "task_id",
            "required": true,
            "schema": {
              "title": "Task Id",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TaskResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Cancel Task",
        "tags": [
          "Tasks"
        ]
      }
    },
    "/tasks/{task_id}/events": {
      "post": {
        "description": "Send an event to a running task.",
        "operationId": "tasks_send_event",
        "parameters": [
          {
            "in": "path",
            "name": "task_id",
            "required": true,
            "schema": {
              "title": "Task Id",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateTaskEventRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Event"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Send Event to Task",
        "tags": [
          "Tasks"
        ],
        "x-fern-retries": {
          "disabled": true
        }
      }
    },
    "/tasks/{task_id}/handler-end": {
      "post": {
        "description": "Signal that an ACP handler has finished processing an event.",
        "operationId": "tasks_handler_end",
        "parameters": [
          {
            "in": "path",
            "name": "task_id",
            "required": true,
            "schema": {
              "title": "Task Id",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/HandlerEndRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HandlerEndResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Handler End",
        "tags": [
          "Tasks"
        ]
      }
    },
    "/tasks/{task_id}/stream": {
      "get": {
        "description": "Stream events for a task by its unique ID using Server-Sent Events (SSE).\n\n    Supports automatic reconnection with Last-Event-ID header. When the client\n    reconnects, it sends the Last-Event-ID header with the last received event ID,\n    and the server resumes from that point.\n\n    Returns TextStreamPart events (Vercel AI SDK compatible format).",
        "operationId": "tasks_stream",
        "parameters": [
          {
            "in": "path",
            "name": "task_id",
            "required": true,
            "schema": {
              "title": "Task Id",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TextStreamPartWrapper"
                }
              }
            },
            "description": "SSE stream of TextStreamPart events"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Stream Task Events by ID",
        "tags": [
          "Tasks"
        ],
        "x-fern-streaming": {
          "format": "sse"
        }
      }
    },
    "/tasks/{task_id}/system-folder-types": {
      "get": {
        "description": "Get all registered system folder types with their configurations for a task.",
        "operationId": "tasks_list_system_folder_types",
        "parameters": [
          {
            "in": "path",
            "name": "task_id",
            "required": true,
            "schema": {
              "title": "Task Id",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/SystemFolderTypeResponse"
                  },
                  "title": "Response Tasks List System Folder Types",
                  "type": "array"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "List System Folder Types",
        "tags": [
          "Tasks"
        ]
      }
    },
    "/tasks/{task_id}/system-folders/{folder_type}": {
      "get": {
        "description": "Get a task's system folder record by type.",
        "operationId": "tasks_get_system_folder",
        "parameters": [
          {
            "in": "path",
            "name": "folder_type",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/SystemFolderType"
            }
          },
          {
            "in": "path",
            "name": "task_id",
            "required": true,
            "schema": {
              "title": "Task Id",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/SystemFolderResponse"
                    },
                    {
                      "type": "null"
                    }
                  ],
                  "title": "Response Tasks Get System Folder"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Get System Folder",
        "tags": [
          "Tasks"
        ]
      }
    },
    "/tasks/{task_id}/system-folders/{folder_type}/download-url": {
      "post": {
        "description": "Get a presigned URL for direct download of a system folder archive from GCS.",
        "operationId": "tasks_get_system_folder_download_url",
        "parameters": [
          {
            "in": "path",
            "name": "folder_type",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/SystemFolderType"
            }
          },
          {
            "in": "path",
            "name": "task_id",
            "required": true,
            "schema": {
              "title": "Task Id",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "anyOf": [
                  {
                    "$ref": "#/components/schemas/PresignedUrlRequest"
                  },
                  {
                    "type": "null"
                  }
                ],
                "title": "Request"
              }
            }
          }
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/PresignedUrlResponse"
                    },
                    {
                      "type": "null"
                    }
                  ],
                  "title": "Response Tasks Get System Folder Download Url"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Get System Folder Download URL",
        "tags": [
          "Tasks"
        ]
      }
    },
    "/tasks/{task_id}/system-folders/{folder_type}/sync-complete": {
      "post": {
        "description": "Complete a system folder sync operation and update metadata.",
        "operationId": "tasks_system_folder_sync_complete",
        "parameters": [
          {
            "in": "path",
            "name": "folder_type",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/SystemFolderType"
            }
          },
          {
            "in": "path",
            "name": "task_id",
            "required": true,
            "schema": {
              "title": "Task Id",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SystemFolderSyncCompleteRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SystemFolderSyncCompleteResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Complete System Folder Sync",
        "tags": [
          "Tasks"
        ]
      }
    },
    "/tasks/{task_id}/system-folders/{folder_type}/upload-url": {
      "post": {
        "description": "Get a presigned URL for direct upload of a system folder archive to GCS.",
        "operationId": "tasks_get_system_folder_upload_url",
        "parameters": [
          {
            "in": "path",
            "name": "folder_type",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/SystemFolderType"
            }
          },
          {
            "in": "path",
            "name": "task_id",
            "required": true,
            "schema": {
              "title": "Task Id",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "anyOf": [
                  {
                    "$ref": "#/components/schemas/PresignedUrlRequest"
                  },
                  {
                    "type": "null"
                  }
                ],
                "title": "Request"
              }
            }
          }
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PresignedUrlResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Get System Folder Upload URL",
        "tags": [
          "Tasks"
        ]
      }
    },
    "/tracker": {
      "get": {
        "description": "List agent task trackers for a task, optionally filtered by agent.",
        "operationId": "tracker_list",
        "parameters": [
          {
            "description": "Agent ID",
            "in": "query",
            "name": "agent_id",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Agent ID",
              "title": "Agent Id"
            }
          },
          {
            "description": "Limit",
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "default": 50,
              "description": "Limit",
              "minimum": 1,
              "title": "Limit",
              "type": "integer"
            }
          },
          {
            "description": "Page number",
            "in": "query",
            "name": "page_number",
            "required": false,
            "schema": {
              "default": 1,
              "description": "Page number",
              "minimum": 1,
              "title": "Page Number",
              "type": "integer"
            }
          },
          {
            "description": "Field to order by",
            "in": "query",
            "name": "order_by",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Field to order by",
              "title": "Order By"
            }
          },
          {
            "description": "Order direction (asc or desc)",
            "in": "query",
            "name": "order_direction",
            "required": false,
            "schema": {
              "default": "desc",
              "description": "Order direction (asc or desc)",
              "title": "Order Direction",
              "type": "string"
            }
          },
          {
            "description": "The task ID",
            "in": "query",
            "name": "task_id",
            "required": true,
            "schema": {
              "description": "The task ID",
              "title": "Task Id",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/AgentTaskTracker"
                  },
                  "title": "Response Tracker List",
                  "type": "array"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "List Agent Task Trackers",
        "tags": [
          "Agent Task Tracker"
        ],
        "x-fern-sdk-group-name": [
          "tracker"
        ],
        "x-fern-sdk-method-name": "list"
      }
    },
    "/tracker/{tracker_id}": {
      "get": {
        "description": "Get agent task tracker by tracker ID",
        "operationId": "tracker_retrieve",
        "parameters": [
          {
            "in": "path",
            "name": "tracker_id",
            "required": true,
            "schema": {
              "title": "Tracker Id",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AgentTaskTracker"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Get Agent Task Tracker",
        "tags": [
          "Agent Task Tracker"
        ],
        "x-fern-sdk-group-name": [
          "tracker"
        ],
        "x-fern-sdk-method-name": "retrieve"
      },
      "put": {
        "description": "Update agent task tracker by tracker ID",
        "operationId": "tracker_update",
        "parameters": [
          {
            "in": "path",
            "name": "tracker_id",
            "required": true,
            "schema": {
              "title": "Tracker Id",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateAgentTaskTrackerRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AgentTaskTracker"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Update Agent Task Tracker",
        "tags": [
          "Agent Task Tracker"
        ],
        "x-fern-sdk-group-name": [
          "tracker"
        ],
        "x-fern-sdk-method-name": "update"
      }
    },
    "/v1/auth/cli/refresh": {
      "post": {
        "description": "Refresh an expired session JWT using a refresh token.\n\nNote: Refresh tokens are single-use. The response contains a new refresh_token\nthat must replace the old one for future refresh operations.",
        "operationId": "refresh_cli_token_v1_auth_cli_refresh_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CLIRefreshRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CLIRefreshResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Refresh Cli Token",
        "tags": [
          "CLI Authentication"
        ]
      }
    },
    "/v1/auth/cli/token": {
      "post": {
        "description": "Exchange authorization code for session JWT using PKCE.",
        "operationId": "exchange_cli_token_v1_auth_cli_token_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CLITokenRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CLITokenResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Exchange Cli Token",
        "tags": [
          "CLI Authentication"
        ]
      }
    },
    "/v1/authn": {
      "post": {
        "description": "Validate a WorkOS JWT and return the principal context.",
        "operationId": "authenticate_v1_authn_post",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PrincipalContextEntity"
                }
              }
            },
            "description": "Successful Response"
          }
        },
        "summary": "Authenticate Token",
        "tags": [
          "Authentication"
        ]
      }
    },
    "/v1/oauth/initiate": {
      "get": {
        "description": "Generate authorization URL for OAuth authentication.",
        "operationId": "initiate_oauth_v1_oauth_initiate_get",
        "parameters": [
          {
            "description": "URI to redirect after authentication",
            "in": "query",
            "name": "redirect_uri",
            "required": true,
            "schema": {
              "description": "URI to redirect after authentication",
              "title": "Redirect Uri",
              "type": "string"
            }
          },
          {
            "description": "PKCE code challenge (S256)",
            "in": "query",
            "name": "code_challenge",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "PKCE code challenge (S256)",
              "title": "Code Challenge"
            }
          },
          {
            "description": "Optional WorkOS connection ID for SSO",
            "in": "query",
            "name": "connection_id",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Optional WorkOS connection ID for SSO",
              "title": "Connection Id"
            }
          },
          {
            "description": "Organization ID to scope the authentication to",
            "in": "query",
            "name": "organization_id",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Organization ID to scope the authentication to",
              "title": "Organization Id"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OAuthInitiateResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Initiate Oauth",
        "tags": [
          "OAuth"
        ]
      }
    },
    "/v1/oauth/token": {
      "post": {
        "description": "Exchange authorization code for access token.",
        "operationId": "exchange_token_v1_oauth_token_post",
        "parameters": [
          {
            "description": "Authorization code from OAuth callback",
            "in": "query",
            "name": "code",
            "required": true,
            "schema": {
              "description": "Authorization code from OAuth callback",
              "title": "Code",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OAuthTokenResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Exchange Token",
        "tags": [
          "OAuth"
        ]
      }
    },
    "/v1/organizations": {
      "get": {
        "description": "List all organizations the current user belongs to.",
        "operationId": "organizations_list",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/OrganizationResponse"
                  },
                  "title": "Response Organizations List",
                  "type": "array"
                }
              }
            },
            "description": "Successful Response"
          }
        },
        "summary": "List User Organizations",
        "tags": [
          "Organizations"
        ]
      }
    },
    "/v1/organizations/current": {
      "get": {
        "description": "Get the current user's organization info.",
        "operationId": "organizations_retrieve_current",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OrganizationResponse"
                }
              }
            },
            "description": "Successful Response"
          }
        },
        "summary": "Get Current Organization",
        "tags": [
          "Organizations"
        ]
      }
    },
    "/v1/organizations/invitations": {
      "get": {
        "description": "List pending invitations for the current organization.",
        "operationId": "organizations_list_invitations",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/OrganizationInvitationResponse"
                  },
                  "title": "Response Organizations List Invitations",
                  "type": "array"
                }
              }
            },
            "description": "Successful Response"
          }
        },
        "summary": "List Organization Invitations",
        "tags": [
          "Organizations"
        ]
      },
      "post": {
        "description": "Invite a user to the current organization. Idempotent for existing pending invites by email.",
        "operationId": "organizations_create_invitation",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateOrganizationInvitationRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CreateOrganizationInvitationResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Create Organization Invitation",
        "tags": [
          "Organizations"
        ]
      }
    },
    "/v1/organizations/invitations/{invitation_id}": {
      "delete": {
        "description": "Revoke a pending invitation in the current organization.",
        "operationId": "organizations_revoke_invitation",
        "parameters": [
          {
            "in": "path",
            "name": "invitation_id",
            "required": true,
            "schema": {
              "title": "Invitation Id",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OrganizationInvitationResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Revoke Organization Invitation",
        "tags": [
          "Organizations"
        ]
      }
    },
    "/v1/organizations/invitations/{invitation_id}/resend": {
      "post": {
        "description": "Resend a pending invitation in the current organization.",
        "operationId": "organizations_resend_invitation",
        "parameters": [
          {
            "in": "path",
            "name": "invitation_id",
            "required": true,
            "schema": {
              "title": "Invitation Id",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OrganizationInvitationResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Resend Organization Invitation",
        "tags": [
          "Organizations"
        ]
      }
    },
    "/v1/organizations/members": {
      "get": {
        "description": "List active members in the current organization.",
        "operationId": "organizations_list_members",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/OrganizationMemberResponse"
                  },
                  "title": "Response Organizations List Members",
                  "type": "array"
                }
              }
            },
            "description": "Successful Response"
          }
        },
        "summary": "List Organization Members",
        "tags": [
          "Organizations"
        ]
      }
    },
    "/v1/organizations/members/{membership_id}": {
      "delete": {
        "description": "Remove an active member from the current organization.",
        "operationId": "organizations_remove_member",
        "parameters": [
          {
            "in": "path",
            "name": "membership_id",
            "required": true,
            "schema": {
              "title": "Membership Id",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DeleteResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Remove Organization Member",
        "tags": [
          "Organizations"
        ]
      },
      "put": {
        "description": "Update a member role in the current organization.",
        "operationId": "organizations_update_member",
        "parameters": [
          {
            "in": "path",
            "name": "membership_id",
            "required": true,
            "schema": {
              "title": "Membership Id",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateOrganizationMemberRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OrganizationMemberResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Update Organization Member",
        "tags": [
          "Organizations"
        ]
      }
    },
    "/v2/messages": {
      "get": {
        "description": "List messages for a task in Vercel AI SDK UIMessage format.\n\n    This endpoint returns messages transformed from raw SDK events into\n    a normalized UIMessage format suitable for frontend consumption.\n\n    Features:\n    - Tool merging: tool_use and tool_result are combined into single tool parts\n    - Complete-units pagination: Never splits tool request/result pairs across pages\n    - Runtime transformation: Raw SDK messages are transformed on-demand\n\n    Args:\n        task_id: The task ID to filter messages by\n        limit: Maximum number of complete messages to return (default: 50)\n        cursor: Opaque cursor string for pagination\n        direction: Pagination direction - \"older\" (default) or \"newer\"\n        parent_tool_use_id: Filter messages by parent tool use ID (for subagent context)\n\n    Returns:\n        ListMessagesV2Response with UIMessages and pagination info",
        "operationId": "messages_v2_list",
        "parameters": [
          {
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "default": 50,
              "title": "Limit",
              "type": "integer"
            }
          },
          {
            "in": "query",
            "name": "cursor",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Cursor"
            }
          },
          {
            "in": "query",
            "name": "direction",
            "required": false,
            "schema": {
              "default": "older",
              "enum": [
                "older",
                "newer"
              ],
              "title": "Direction",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "parent_tool_use_id",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Parent Tool Use Id"
            }
          },
          {
            "description": "The task ID",
            "in": "query",
            "name": "task_id",
            "required": true,
            "schema": {
              "description": "The task ID",
              "title": "Task Id",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ListMessagesV2Response"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "List Messages (v2 - UIMessage format)",
        "tags": [
          "Messages v2"
        ],
        "x-fern-pagination": {
          "cursor": "$request.cursor",
          "next_cursor": "$response.nextCursor",
          "results": "$response.data"
        }
      }
    },
    "/v2/messages/{message_id}": {
      "get": {
        "description": "Get a single message by ID in UIMessage format.\n\n    Returns the transformed UIMessage or null if not found.",
        "operationId": "messages_v2_retrieve",
        "parameters": [
          {
            "in": "path",
            "name": "message_id",
            "required": true,
            "schema": {
              "title": "Message Id",
              "type": "string"
            }
          },
          {
            "description": "The task ID",
            "in": "query",
            "name": "task_id",
            "required": true,
            "schema": {
              "description": "The task ID",
              "title": "Task Id",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/UIMessage"
                    },
                    {
                      "type": "null"
                    }
                  ],
                  "title": "Response Messages V2 Retrieve"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Get Message (v2 - UIMessage format)",
        "tags": [
          "Messages v2"
        ]
      }
    },
    "/versions/register": {
      "post": {
        "description": "Register an agent container that has started up.\n\n    Called by the agent container on startup to:\n    1. Register its ACP URL with the platform\n    2. Receive its API key for authenticating subsequent requests\n\n    This endpoint should be called from within the container's entrypoint\n    after the ACP server is ready to receive traffic.",
        "operationId": "versions_register",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RegisterContainerRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RegisterContainerResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Register Container",
        "tags": [
          "Versions"
        ]
      }
    },
    "/versions/{version_id}": {
      "get": {
        "description": "Get version details by ID.",
        "operationId": "retrieve",
        "parameters": [
          {
            "in": "path",
            "name": "version_id",
            "required": true,
            "schema": {
              "title": "Version Id",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VersionResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Get Version",
        "tags": [
          "Branches",
          "Versions"
        ],
        "x-fern-sdk-group-name": [
          "versions"
        ],
        "x-fern-sdk-method-name": "retrieve"
      }
    },
    "/versions/{version_id}/deploy/events": {
      "get": {
        "description": "SSE endpoint for real-time deployment progress events.",
        "operationId": "versions_deploy_stream",
        "parameters": [
          {
            "in": "path",
            "name": "version_id",
            "required": true,
            "schema": {
              "title": "Version Id",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DeployStreamEvent"
                }
              },
              "text/event-stream": {
                "schema": {
                  "$ref": "#/components/schemas/DeployStreamEvent"
                }
              }
            },
            "description": "SSE stream of deployment events"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Stream Deployment Progress",
        "tags": [
          "Versions"
        ],
        "x-fern-sdk-group-name": [
          "versions"
        ],
        "x-fern-sdk-method-name": "deploy_stream",
        "x-fern-streaming": {
          "format": "sse"
        }
      }
    },
    "/versions/{version_id}/events": {
      "get": {
        "description": "List lifecycle events for a version. Events are ordered by sequence_id.",
        "operationId": "versions_events_list",
        "parameters": [
          {
            "in": "path",
            "name": "version_id",
            "required": true,
            "schema": {
              "title": "Version Id",
              "type": "string"
            }
          },
          {
            "description": "Filter by event type",
            "in": "query",
            "name": "event_type",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "$ref": "#/components/schemas/VersionEventType"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Filter by event type",
              "title": "Event Type"
            }
          },
          {
            "description": "Return events after this sequence_id (for ascending pagination)",
            "in": "query",
            "name": "after_sequence_id",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "integer"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Return events after this sequence_id (for ascending pagination)",
              "title": "After Sequence Id"
            }
          },
          {
            "description": "Return events before this sequence_id (for descending pagination)",
            "in": "query",
            "name": "before_sequence_id",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "integer"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Return events before this sequence_id (for descending pagination)",
              "title": "Before Sequence Id"
            }
          },
          {
            "description": "Maximum events to return",
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "default": 50,
              "description": "Maximum events to return",
              "maximum": 100,
              "minimum": 1,
              "title": "Limit",
              "type": "integer"
            }
          },
          {
            "description": "Order by sequence_id descending (newest first)",
            "in": "query",
            "name": "descending",
            "required": false,
            "schema": {
              "default": true,
              "description": "Order by sequence_id descending (newest first)",
              "title": "Descending",
              "type": "boolean"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VersionEventListResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "List Version Events",
        "tags": [
          "Version Events"
        ]
      }
    },
    "/versions/{version_id}/metrics": {
      "get": {
        "description": "Get deployment metrics for a specific version.\n\n    Returns metrics related to the deployment process for this version,\n    including average and P95 deployment durations queried from ClickHouse traces.",
        "operationId": "versions_metrics",
        "parameters": [
          {
            "in": "path",
            "name": "version_id",
            "required": true,
            "schema": {
              "title": "Version Id",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VersionMetricsResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Get Version Metrics",
        "tags": [
          "Versions"
        ]
      }
    },
    "/versions/{version_id}/pod-logs": {
      "get": {
        "description": "Get Kubernetes pod/container logs for a specific deployment version.\n\n    Data is sourced from ClickHouse `otel.pod_logs`, populated by the dedicated\n    pod-log collector DaemonSet. This endpoint has no Kubernetes or event-snapshot\n    fallback path.",
        "operationId": "versions_pod_logs",
        "parameters": [
          {
            "in": "path",
            "name": "version_id",
            "required": true,
            "schema": {
              "title": "Version Id",
              "type": "string"
            }
          },
          {
            "description": "Filter by pod name",
            "in": "query",
            "name": "pod",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Filter by pod name",
              "title": "Pod"
            }
          },
          {
            "description": "Filter by container name",
            "in": "query",
            "name": "container",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Filter by container name",
              "title": "Container"
            }
          },
          {
            "description": "Filter by log stream (stdout/stderr)",
            "in": "query",
            "name": "stream",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Filter by log stream (stdout/stderr)",
              "title": "Stream"
            }
          },
          {
            "description": "Start timestamp filter (ISO 8601)",
            "in": "query",
            "name": "since",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "format": "date-time",
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Start timestamp filter (ISO 8601)",
              "title": "Since"
            }
          },
          {
            "description": "End timestamp filter (ISO 8601)",
            "in": "query",
            "name": "until",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "format": "date-time",
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "End timestamp filter (ISO 8601)",
              "title": "Until"
            }
          },
          {
            "description": "Full-text search in log message",
            "in": "query",
            "name": "search",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "maxLength": 500,
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Full-text search in log message",
              "title": "Search"
            }
          },
          {
            "description": "Maximum number of results",
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "default": 100,
              "description": "Maximum number of results",
              "maximum": 1000,
              "minimum": 1,
              "title": "Limit",
              "type": "integer"
            }
          },
          {
            "description": "Cursor for the next page, using the previous log_id",
            "in": "query",
            "name": "after",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Cursor for the next page, using the previous log_id",
              "title": "After"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VersionPodLogsResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Get Version Pod Logs",
        "tags": [
          "Versions"
        ],
        "x-fern-sdk-group-name": [
          "versions"
        ],
        "x-fern-sdk-method-name": "pod_logs"
      }
    },
    "/versions/{version_id}/pod-metrics": {
      "get": {
        "description": "Get pod-level resource metrics (CPU and memory) for a specific version.\n\n    Data is sourced from ClickHouse `otel_metrics_*` tables populated by the\n    OpenTelemetry Collector's Prometheus receiver scraping kubelet cAdvisor metrics.",
        "operationId": "versions_pod_metrics",
        "parameters": [
          {
            "in": "path",
            "name": "version_id",
            "required": true,
            "schema": {
              "title": "Version Id",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "window_minutes",
            "required": false,
            "schema": {
              "default": 60,
              "title": "Window Minutes",
              "type": "integer"
            }
          },
          {
            "in": "query",
            "name": "step_seconds",
            "required": false,
            "schema": {
              "default": 60,
              "title": "Step Seconds",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VersionPodMetricsResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Get Version Pod Metrics",
        "tags": [
          "Versions"
        ],
        "x-fern-sdk-group-name": [
          "versions"
        ],
        "x-fern-sdk-method-name": "pod_metrics"
      }
    }
  },
  "x-fern-idempotency-headers": [
    {
      "header": "Idempotency-Key",
      "name": "idempotency_key"
    }
  ]
}
