// This file is auto-generated by @hey-api/openapi-ts

export type ClientOptions = {
    baseUrl: `${string}://${string}/publishers/seren-agent` | (string & {});
};

/**
 * Lease for a single action on a tool. Borrows the OpenFang/IronClaw
 * pattern: permission is granted per-action, not per-process, with optional
 * expiry, use budget, and a parent lease ref for sub-agent inheritance.
 *
 * `capability` distinguishes blanket grants (all sub-actions of `action`)
 * from a closed `Specific` set. Sub-agents that fork from a parent must
 * hold leases whose capability is a subset of the parent's — runtime
 * enforcement (when implemented) lives outside this DTO; here we validate
 * shape only.
 */
export type ActionLease = {
    /**
     * Action name being leased. Free-form per tool; e.g. `read`, `send`,
     * `execute`, `delete`, `list`.
     */
    action: string;
    capability: GrantedActions;
    /**
     * Lease expiry as RFC 3339; `None` means no time bound.
     */
    expiry?: string | null;
    /**
     * Identifier of the parent lease this one inherits from. Shape-only
     * validation here checks that the value is non-empty when set; the
     * referenced lease is not looked up. Inheritance resolution (parent must
     * hold a capability superset) happens at runtime.
     */
    parent_lease_ref?: string | null;
    /**
     * Maximum number of invocations before the lease must be re-issued.
     * `None` means unlimited.
     */
    use_budget?: number | null;
};

/**
 * Non-prompt file that belongs to an agent bundle.
 */
export type AgentAssetFile = {
    /**
     * Base64-encoded file body.
     */
    content_base64: string;
    /**
     * Optional MIME type supplied by the caller.
     */
    content_type?: string | null;
    /**
     * Agent-bundle relative path.
     */
    path: string;
    purpose?: null | AgentAssetPurpose;
    /**
     * Optional content digest for provenance. When present, the server verifies it.
     */
    sha256?: string | null;
};

export type AgentAssetPurpose = 'reference' | 'script' | 'schema' | 'resource' | 'eval';

/**
 * Authored agent bundle used by LLM workloads.
 */
export type AgentBundle = {
    /**
     * Additional files available to the agent runtime.
     */
    assets?: Array<AgentAssetFile>;
    /**
     * Prompt-bearing instruction files rendered server-side into the runtime
     * system prompt.
     */
    instructions?: Array<AgentInstructionFile>;
};

/**
 * Partial agent-bundle update for an existing managed deployment.
 */
export type AgentBundlePatch = {
    /**
     * Asset paths to remove before applying upserts.
     */
    remove_assets?: Array<string>;
    /**
     * Instruction files to remove before applying upserts.
     */
    remove_instructions?: Array<AgentInstructionFileSelector>;
    /**
     * Asset files to insert or replace. Identity is `path`.
     */
    upsert_assets?: Array<AgentAssetFile>;
    /**
     * Instruction files to insert or replace. Identity is `(kind, path)`.
     */
    upsert_instructions?: Array<AgentInstructionFile>;
};

export type AgentCapabilitiesResponse = {
    deployment_runtime_api: string;
    deployment_targets: Array<string>;
    orchestration_plane: boolean;
    publisher: string;
    runtime_provider: string;
    supported_model_policies: Array<string>;
    supported_templates: Array<string>;
    supported_tool_presets: Array<string>;
    supports_direct_skill_deploy: boolean;
    supports_orchestrated_deploy: boolean;
};

export type AgentCredentialBinding = 'env' | 'header' | 'body' | 'proxy_inject';

export type AgentCredentialKind = 'api_key' | 'oauth2_token' | 'basic' | 'mtls' | 'aws_sig_v4' | 'gcp_service_account';

/**
 * Reference to a credential held by Seren's control plane or organization
 * secret store, injected at the declared binding point.
 */
export type AgentCredentialRef = {
    /**
     * How the credential is delivered. `env` is the only mode the runtime
     * implements today; other modes are accepted on the contract and reserved
     * for the egress proxy phase of the credential boundary work.
     */
    binding: AgentCredentialBinding;
    binding_target?: string | null;
    kind: AgentCredentialKind;
    /**
     * Name the workload uses to address the credential.
     */
    name: string;
    /**
     * URI of the credential record. Supported schemes:
     * `control-plane://providers/{id}`, `org-secret://{key}`, `user-secret://{key}`.
     */
    ref_uri: string;
    rotation?: null | AgentCredentialRotationPolicy;
};

export type AgentCredentialRotationPolicy = {
    allow_rotate: boolean;
    max_age_seconds?: number | null;
};

export type AgentFilesystemEnforcement = 'best_effort' | 'hard_requirement';

export type AgentFilesystemPolicy = {
    /**
     * How strictly the runtime should enforce these paths.
     */
    enforcement?: AgentFilesystemEnforcement;
    /**
     * Absolute paths the workload may read but not write.
     */
    read_only_paths?: Array<string>;
    /**
     * Absolute paths the workload may read and write.
     */
    read_write_paths?: Array<string>;
};

export type AgentGuardrailOnFail = 'retry' | 'block' | 'fix' | 'human';

/**
 * Typed guardrail policy attached to a managed agent.
 */
export type AgentGuardrailPolicy = {
    description?: string | null;
    /**
     * When true, fail events route into the unified approval inbox for human review.
     */
    human_inbox?: boolean;
    max_retries?: number | null;
    /**
     * Unique within the deployment; used in `guardrail_pass`/`guardrail_fail`
     * events.
     */
    name: string;
    on_fail?: AgentGuardrailOnFail;
    target: AgentGuardrailTarget;
    /**
     * Optional tool name; when present, the guardrail only fires on that tool.
     */
    tool?: string | null;
    validator: AgentGuardrailValidator;
};

export type AgentGuardrailTarget = 'input' | 'output' | 'tool_input' | 'tool_output';

export type AgentGuardrailValidator = {
    kind: 'regex';
    pattern: string;
} | {
    kind: 'llm_judge';
    model?: string | null;
    prompt: string;
} | {
    function_ref: string;
    kind: 'custom_fn';
};

/**
 * One authored instruction file.
 *
 * Supports inline instruction bodies as well as packaged workload metadata.
 */
export type AgentInstructionFile = {
    /**
     * Optional tool allowlist carried by skill metadata.
     */
    allowed_tools?: Array<string> | null;
    /**
     * File body. Packaged workloads should provide the materialized instruction text.
     */
    content: string;
    kind: AgentInstructionKind;
    /**
     * Original or packaged path, when known.
     */
    path?: string | null;
    /**
     * Optional content digest for packaged workload provenance.
     */
    sha256?: string | null;
    /**
     * Skill directory name, when the instruction came from a packaged skill.
     */
    skill_name?: string | null;
};

/**
 * Selects instruction files to remove from a managed deployment bundle.
 */
export type AgentInstructionFileSelector = {
    kind: AgentInstructionKind;
    /**
     * Original or packaged path. When omitted, every instruction with this kind is selected.
     */
    path?: string | null;
};

/**
 * Typed instruction-file kind for managed LLM workloads.
 */
export type AgentInstructionKind = 'identity' | 'soul' | 'skill' | 'agents' | 'user' | 'tools' | 'memory' | 'heartbeat' | 'eval';

export type AgentMemoryCompactionPolicy = {
    event_retention_count: number;
    overlap_tokens: number;
    summarizer_model?: string | null;
    token_threshold: number;
};

/**
 * Typed memory policy declared by a managed agent.
 */
export type AgentMemoryPolicy = {
    compaction?: null | AgentMemoryCompactionPolicy;
    semantic_memory?: null | AgentSemanticMemoryPolicy;
    /**
     * Optional retention for raw run transcripts (days).
     */
    transcript_retention_days?: number | null;
};

export type AgentNetworkAccessPreset = 'read_only' | 'read_write' | 'full';

export type AgentNetworkDefault = 'deny' | 'allow';

export type AgentNetworkEgressRule = {
    access_preset?: null | AgentNetworkAccessPreset;
    /**
     * Optional per-binary glob list restricting which processes may use the rule.
     */
    binaries?: Array<string>;
    /**
     * Whether matches enforce or just audit.
     */
    enforcement?: AgentNetworkEnforcement;
    host: string;
    /**
     * Optional HTTP methods this rule applies to (rest/sse protocols only).
     */
    methods?: Array<string>;
    /**
     * Optional path globs this rule applies to (rest/sse protocols only).
     */
    paths?: Array<string>;
    port: number;
    protocol: AgentNetworkProtocol;
};

export type AgentNetworkEnforcement = 'enforce' | 'audit';

export type AgentNetworkPolicy = {
    /**
     * When true, blocked egress requests are queued for operator approval
     * (shares an inbox with tool approvals).
     */
    blocked_request_inbox?: boolean;
    /**
     * Wall-clock cap (in seconds) on how long the runtime will hold a
     * single blocked-egress request waiting for an operator decision before
     * surfacing it as `Expired`. When `None`, the runtime applies its
     * built-in default (30 minutes).
     */
    blocked_request_max_wait_seconds?: number | null;
    /**
     * Default disposition when no rule matches a request.
     */
    default?: AgentNetworkDefault;
    /**
     * Ordered egress rules. The first matching rule decides the request.
     */
    egress_rules?: Array<AgentNetworkEgressRule>;
};

export type AgentNetworkProtocol = 'tcp' | 'rest' | 'sse' | 'websocket';

export type AgentProcessPolicy = {
    /**
     * Linux capabilities to drop. Defaults to `["ALL"]` at the controller.
     */
    capability_drop?: Array<string>;
    no_new_privileges?: boolean;
    /**
     * Optional uid:gid pair (e.g. `1000:1000`) the workload runs under.
     */
    run_as_user?: string | null;
    /**
     * Seccomp profile name; defaults to the runtime default.
     */
    seccomp_profile?: string | null;
};

export type AgentRemoteAgentAuth = 'none' | 'bearer' | 'mtls';

export type AgentRemoteAgentTransport = 'https' | 'sse' | 'websocket';

export type AgentRemoteHttpAuth = 'none' | 'bearer' | 'api_key' | 'basic' | 'mtls';

export type AgentRemoteHttpMethod = 'get' | 'post' | 'put' | 'patch' | 'delete';

export type AgentResourcePolicy = {
    cpu_limit?: string | null;
    cpu_request?: string | null;
    ephemeral_storage_limit?: string | null;
    max_artifact_bytes?: number | null;
    max_output_bytes?: number | null;
    max_runtime_seconds?: number | null;
    max_tool_calls?: number | null;
    memory_limit?: string | null;
    memory_request?: string | null;
};

export type AgentRuntimeClass = 'default' | 'gvisor' | 'kata';

/**
 * Typed runtime policy that a managed agent declares as part of its `AgentSpec`.
 *
 * The control plane validates this object on create/update; the runtime
 * controller renders it into Kubernetes objects (security context, resource
 * limits, NetworkPolicy). Today the controller renders a subset; fields it
 * does not yet honor remain part of the declared contract so revisions and
 * rollbacks stay consistent.
 */
export type AgentRuntimePolicy = {
    filesystem?: null | AgentFilesystemPolicy;
    network?: null | AgentNetworkPolicy;
    process?: null | AgentProcessPolicy;
    resources?: null | AgentResourcePolicy;
    runtime_class?: null | AgentRuntimeClass;
    /**
     * Policy schema version. Must be `1` until a breaking field set is added.
     */
    version: number;
};

export type AgentSemanticMemoryPolicy = {
    /**
     * Optional embedding model reference.
     */
    embedding_model_ref?: string | null;
    enabled: boolean;
    read_policy?: AgentSemanticMemoryReadPolicy;
    retention_days?: number | null;
    store?: AgentSemanticMemoryStore;
    write_policy?: AgentSemanticMemoryWritePolicy;
};

export type AgentSemanticMemoryReadPolicy = 'explicit_tool' | 'always_on';

export type AgentSemanticMemoryStore = 'org_default' | 'external';

export type AgentSemanticMemoryWritePolicy = 'explicit_tool' | 'on_observation' | 'none';

/**
 * Managed deploy request for the `seren-agent` first-class publisher.
 */
export type AgentSpec = {
    /**
     * Optional stable slug for the agent. If omitted, derived from `name`.
     */
    agent_slug?: string | null;
    alert_policy?: null | CloudDeploymentAlertPolicy;
    /**
     * Optional allowlist for remote A2A delegation targets.
     *
     * Entries may be either hostnames (for example `agents.example.com`) or
     * full origins (for example `https://agents.example.com`).
     */
    allowed_remote_agent_origins?: Array<string> | null;
    approval_policy?: null | ManagedAgentApprovalPolicy;
    /**
     * Optional credential references resolved by the control plane at runtime.
     */
    credentials?: Array<AgentCredentialRef> | null;
    /**
     * Cron schedule expression, required when `mode` is `cron`.
     */
    cron_schedule?: string | null;
    /**
     * Timezone for cron schedules. Defaults to `UTC` when omitted.
     */
    cron_timezone?: string | null;
    /**
     * Optional dashboard rendering config.
     */
    dashboard_config?: unknown;
    eval_gate?: null | EvalGate;
    /**
     * Optional guardrail policies applied at input/output/tool boundaries.
     */
    guardrails?: Array<AgentGuardrailPolicy> | null;
    memory_policy?: null | AgentMemoryPolicy;
    /**
     * Deployment mode.
     */
    mode: CloudDeploymentMode;
    model_policy?: null | ManagedAgentModelPolicy;
    /**
     * Human-readable agent name. Auto-generated when omitted.
     */
    name?: string | null;
    private_output_policy?: null | ManagedAgentPrivateOutputPolicy;
    runtime_policy?: null | AgentRuntimePolicy;
    session_database?: null | ManagedAgentSessionDatabase;
    template?: null | ManagedAgentTemplate;
    /**
     * Managed tool presets. Defaults to `live_data`.
     */
    tool_presets?: Array<ManagedAgentToolPreset> | null;
    /**
     * Optional typed tool references. Coexists with `tool_presets` so the
     * runtime can resolve from typed refs and preset groups together.
     */
    tool_refs?: Array<AgentToolRef> | null;
    /**
     * Visibility mode (`open` or `opaque`).
     */
    visibility?: string | null;
    /**
     * Runtime workload specification (execution strategy, compute, limits, ...).
     */
    workload: WorkloadSpec;
};

/**
 * Partial update request for an existing managed `seren-agent` deployment.
 *
 * Mirrors the agent-level fields of `AgentSpec` as `Option<...>` for partial
 * update. The `workload` field replaces the entire `WorkloadSpec` when
 * present; partial-workload patching is intentionally out of scope.
 */
export type AgentSpecUpdate = {
    /**
     * Updated stable slug for the agent.
     */
    agent_slug?: string | null;
    alert_policy?: null | CloudDeploymentAlertPolicy;
    /**
     * Updated allowlist for remote A2A delegation targets.
     */
    allowed_remote_agent_origins?: Array<string> | null;
    approval_policy?: null | ManagedAgentApprovalPolicy;
    /**
     * Clear any existing alert policy.
     */
    clear_alert_policy?: boolean;
    /**
     * Clear any existing credential references.
     */
    clear_credentials?: boolean;
    /**
     * Clear any existing dashboard config.
     */
    clear_dashboard_config?: boolean;
    /**
     * Clear any existing eval gate configuration.
     */
    clear_eval_gate?: boolean;
    /**
     * Clear any existing guardrail list.
     */
    clear_guardrails?: boolean;
    /**
     * Clear any existing memory policy.
     */
    clear_memory_policy?: boolean;
    /**
     * Clear any existing runtime policy.
     */
    clear_runtime_policy?: boolean;
    /**
     * Clear any existing external session database configuration.
     */
    clear_session_database?: boolean;
    /**
     * Clear any existing typed tool refs.
     */
    clear_tool_refs?: boolean;
    /**
     * Updated credential references. Replaces the entire previous list when present.
     */
    credentials?: Array<AgentCredentialRef> | null;
    /**
     * Updated cron schedule. Only valid for cron deployments.
     */
    cron_schedule?: string | null;
    /**
     * Updated cron timezone. Only valid for cron deployments.
     */
    cron_timezone?: string | null;
    /**
     * Updated dashboard rendering config.
     */
    dashboard_config?: unknown;
    eval_gate?: null | EvalGate;
    /**
     * Updated guardrail list. Replaces the entire previous list when present.
     */
    guardrails?: Array<AgentGuardrailPolicy> | null;
    memory_policy?: null | AgentMemoryPolicy;
    model_policy?: null | ManagedAgentModelPolicy;
    /**
     * Updated human-readable agent name.
     */
    name?: string | null;
    private_output_policy?: null | ManagedAgentPrivateOutputPolicy;
    runtime_policy?: null | AgentRuntimePolicy;
    session_database?: null | ManagedAgentSessionDatabase;
    template?: null | ManagedAgentTemplate;
    /**
     * Updated managed tool presets.
     */
    tool_presets?: Array<ManagedAgentToolPreset> | null;
    /**
     * Updated typed tool refs. Replaces the entire previous list when present.
     */
    tool_refs?: Array<AgentToolRef> | null;
    /**
     * Updated visibility mode (`open` or `opaque`).
     */
    visibility?: string | null;
    workload?: null | WorkloadSpec;
};

/**
 * Typed tool reference attached to an agent. Lives alongside the coarser
 * `tool_presets` field; future managed-agent flows resolve from typed refs and
 * presets together. Each non-preset variant carries an optional
 * `permitted_actions` collection of `ActionLease`s — the per-action gate
 * borrowed from OpenFang/IronClaw that lets the spec say "this Connector may
 * perform `read` but not `send`" without inventing a separate ACL surface.
 */
export type AgentToolRef = {
    kind: 'publisher';
    operation_id: string;
    permitted_actions?: Array<ActionLease>;
    publisher_slug: string;
    require_approval?: boolean;
} | {
    kind: 'mcp';
    permitted_actions?: Array<ActionLease>;
    require_approval?: boolean;
    server_ref: string;
    tool_name: string;
} | {
    capability: string;
    connector_ref: string;
    kind: 'connector';
    permitted_actions?: Array<ActionLease>;
    require_approval?: boolean;
    scopes?: Array<string>;
} | {
    auth_mode: AgentRemoteAgentAuth;
    expected_card_digest?: string | null;
    kind: 'remote_agent';
    origin: string;
    permitted_actions?: Array<ActionLease>;
    require_approval?: boolean;
    timeout_ms?: number | null;
    transport: AgentRemoteAgentTransport;
} | {
    auth_mode: AgentRemoteHttpAuth;
    endpoint: string;
    kind: 'remote_http';
    method: AgentRemoteHttpMethod;
    name: string;
    permitted_actions?: Array<ActionLease>;
    require_approval?: boolean;
    timeout_ms?: number | null;
} | {
    kind: 'preset_group';
    preset: ManagedAgentToolPreset;
};

/**
 * Generic status payload used by cloud deployment lifecycle endpoints.
 */
export type CloudDeploymentActionStatusResponse = {
    status: string;
};

/**
 * Run-status event that can trigger a deployment alert webhook.
 */
export type CloudDeploymentAlertEvent = 'awaiting_approval' | 'failed' | 'blocked' | 'timeout' | 'completed' | 'cancelled';

/**
 * Deployment-level operator alert policy.
 */
export type CloudDeploymentAlertPolicy = {
    /**
     * Run events that should trigger the webhook.
     */
    events?: Array<CloudDeploymentAlertEvent>;
    /**
     * Secret key whose value is the destination webhook URL.
     */
    webhook_secret_key: string;
};

/**
 * Cloud deployment compute backend target.
 */
export type CloudDeploymentComputeBackend = 'aws_container' | 'cloudflare_worker' | 'daytona';

/**
 * Computed evaluation gate status for a deployment.
 */
export type CloudDeploymentEvalGateStatus = {
    blocking: boolean;
    checked_at: string;
    eval_gate_max_age_seconds: number;
    eval_gate_set_id: string;
    fresh_until?: string | null;
    latest_eval_run_completed_at?: string | null;
    latest_eval_run_id?: string | null;
    latest_eval_run_status?: string | null;
    latest_verdict_passed?: boolean | null;
    latest_verdict_status?: string | null;
    message: string;
    state: string;
};

/**
 * Cloud deployment execution mode.
 */
export type CloudDeploymentMode = 'always_on' | 'cron' | 'job';

/**
 * Deployment-level outbound network restrictions for sandboxed execution backends.
 */
export type CloudDeploymentNetworkPolicy = {
    /**
     * Explicit IPv4 CIDR ranges allowed for outbound access.
     */
    allow_list?: Array<string>;
    /**
     * When true, block all outbound network access from the deployment runtime.
     */
    block_all?: boolean;
};

/**
 * Cloud deployment runtime kind (language/runtime format).
 */
export type CloudDeploymentRuntimeKind = 'python' | 'javascript' | 'typescript' | 'rust' | 'rust_wasm_adk';

/**
 * Cloud deployment lifecycle status.
 */
export type CloudDeploymentStatus = 'pending' | 'building' | 'running' | 'stopped' | 'failed';

/**
 * Summary view for listing deployments (excludes large fields like code_bundle).
 */
export type CloudDeploymentSummary = {
    /**
     * Current managed-agent revision, when this is a managed seren-agent deployment.
     */
    active_revision_id?: string | null;
    alert_policy?: null | CloudDeploymentAlertPolicy;
    code_bundle_hash: string;
    compute_backend: CloudDeploymentComputeBackend;
    created_at: string;
    cron_schedule?: string | null;
    cron_timezone?: string | null;
    dashboard_config?: unknown;
    deployment_bundle_id?: string | null;
    endpoint_url?: string | null;
    environment_id?: string | null;
    error_message?: string | null;
    eval_gate_max_age_seconds?: number | null;
    eval_gate_set_id?: string | null;
    eval_gate_status?: null | CloudDeploymentEvalGateStatus;
    id: string;
    managed_agent?: null | ManagedAgentSummary;
    mode: CloudDeploymentMode;
    model_id?: string | null;
    name: string;
    network_policy?: null | CloudDeploymentNetworkPolicy;
    orchestration_mode: OrchestrationMode;
    organization_id: string;
    publisher_only?: boolean;
    requirements: unknown;
    runtime_kind: CloudDeploymentRuntimeKind;
    skill_slug: string;
    status: CloudDeploymentStatus;
    updated_at: string;
    user_id: string;
    /**
     * Visibility mode: "open" (default) or "opaque" (redacts selected details from non-owners).
     */
    visibility: string;
};

/**
 * Generic API response wrapper with optional pagination
 *
 * This wrapper provides a consistent structure for all API responses,
 * making it easier for clients to handle responses uniformly. It supports
 * both single resources and collections, with optional pagination metadata.
 * Publisher endpoints use the same wrapper for non-streaming JSON success
 * responses, including first-class publishers. Streaming endpoints such as
 * SSE responses carry metering in response headers and are not wrapped.
 * Payment-required and error responses are also not wrapped so clients can
 * parse their existing wire contracts directly.
 *
 * # Response Structure
 *
 * ```json
 * {
 * "data": T,
 * "pagination": { ... } // optional
 * }
 * ```
 *
 * # Examples
 *
 * ## Single Resource
 *
 * ```rust
 * use seren_core::http::DataResponse;
 * use serde::Serialize;
 *
 * #[derive(Serialize)]
 * struct Project {
 * id: String,
 * name: String,
 * }
 *
 * let project = Project {
 * id: "123".to_string(),
 * name: "My Project".to_string(),
 * };
 *
 * let response = DataResponse::new(project);
 * // Serializes to: {"data": {"id": "123", "name": "My Project"}}
 * ```
 *
 * ## Collection with Pagination
 *
 * ```rust
 * use seren_core::http::DataResponse;
 * use seren_core::pagination::PaginationMeta;
 * use serde::Serialize;
 *
 * #[derive(Serialize)]
 * struct Project {
 * id: String,
 * name: String,
 * }
 *
 * let projects: Vec<Project> = Vec::new();
 * let pagination = PaginationMeta {
 * total: 0,
 * count: 0,
 * limit: 20,
 * offset: 0,
 * has_more: false,
 * };
 *
 * let response = DataResponse::with_pagination(projects, pagination);
 * // Serializes to: {"data": [...], "pagination": {"total": 0, "count": 0, "limit": 20, "offset": 0, "has_more": false}}
 * ```
 */
export type DataResponseAgentCapabilitiesResponse = {
    data: {
        deployment_runtime_api: string;
        deployment_targets: Array<string>;
        orchestration_plane: boolean;
        publisher: string;
        runtime_provider: string;
        supported_model_policies: Array<string>;
        supported_templates: Array<string>;
        supported_tool_presets: Array<string>;
        supports_direct_skill_deploy: boolean;
        supports_orchestrated_deploy: boolean;
    };
    pagination?: null | PaginationMeta;
};

/**
 * Generic API response wrapper with optional pagination
 *
 * This wrapper provides a consistent structure for all API responses,
 * making it easier for clients to handle responses uniformly. It supports
 * both single resources and collections, with optional pagination metadata.
 * Publisher endpoints use the same wrapper for non-streaming JSON success
 * responses, including first-class publishers. Streaming endpoints such as
 * SSE responses carry metering in response headers and are not wrapped.
 * Payment-required and error responses are also not wrapped so clients can
 * parse their existing wire contracts directly.
 *
 * # Response Structure
 *
 * ```json
 * {
 * "data": T,
 * "pagination": { ... } // optional
 * }
 * ```
 *
 * # Examples
 *
 * ## Single Resource
 *
 * ```rust
 * use seren_core::http::DataResponse;
 * use serde::Serialize;
 *
 * #[derive(Serialize)]
 * struct Project {
 * id: String,
 * name: String,
 * }
 *
 * let project = Project {
 * id: "123".to_string(),
 * name: "My Project".to_string(),
 * };
 *
 * let response = DataResponse::new(project);
 * // Serializes to: {"data": {"id": "123", "name": "My Project"}}
 * ```
 *
 * ## Collection with Pagination
 *
 * ```rust
 * use seren_core::http::DataResponse;
 * use seren_core::pagination::PaginationMeta;
 * use serde::Serialize;
 *
 * #[derive(Serialize)]
 * struct Project {
 * id: String,
 * name: String,
 * }
 *
 * let projects: Vec<Project> = Vec::new();
 * let pagination = PaginationMeta {
 * total: 0,
 * count: 0,
 * limit: 20,
 * offset: 0,
 * has_more: false,
 * };
 *
 * let response = DataResponse::with_pagination(projects, pagination);
 * // Serializes to: {"data": [...], "pagination": {"total": 0, "count": 0, "limit": 20, "offset": 0, "has_more": false}}
 * ```
 */
export type DataResponseCloudDeploymentActionStatusResponse = {
    /**
     * Generic status payload used by cloud deployment lifecycle endpoints.
     */
    data: {
        status: string;
    };
    pagination?: null | PaginationMeta;
};

/**
 * Generic API response wrapper with optional pagination
 *
 * This wrapper provides a consistent structure for all API responses,
 * making it easier for clients to handle responses uniformly. It supports
 * both single resources and collections, with optional pagination metadata.
 * Publisher endpoints use the same wrapper for non-streaming JSON success
 * responses, including first-class publishers. Streaming endpoints such as
 * SSE responses carry metering in response headers and are not wrapped.
 * Payment-required and error responses are also not wrapped so clients can
 * parse their existing wire contracts directly.
 *
 * # Response Structure
 *
 * ```json
 * {
 * "data": T,
 * "pagination": { ... } // optional
 * }
 * ```
 *
 * # Examples
 *
 * ## Single Resource
 *
 * ```rust
 * use seren_core::http::DataResponse;
 * use serde::Serialize;
 *
 * #[derive(Serialize)]
 * struct Project {
 * id: String,
 * name: String,
 * }
 *
 * let project = Project {
 * id: "123".to_string(),
 * name: "My Project".to_string(),
 * };
 *
 * let response = DataResponse::new(project);
 * // Serializes to: {"data": {"id": "123", "name": "My Project"}}
 * ```
 *
 * ## Collection with Pagination
 *
 * ```rust
 * use seren_core::http::DataResponse;
 * use seren_core::pagination::PaginationMeta;
 * use serde::Serialize;
 *
 * #[derive(Serialize)]
 * struct Project {
 * id: String,
 * name: String,
 * }
 *
 * let projects: Vec<Project> = Vec::new();
 * let pagination = PaginationMeta {
 * total: 0,
 * count: 0,
 * limit: 20,
 * offset: 0,
 * has_more: false,
 * };
 *
 * let response = DataResponse::with_pagination(projects, pagination);
 * // Serializes to: {"data": [...], "pagination": {"total": 0, "count": 0, "limit": 20, "offset": 0, "has_more": false}}
 * ```
 */
export type DataResponseCloudDeploymentSummary = {
    /**
     * Summary view for listing deployments (excludes large fields like code_bundle).
     */
    data: {
        /**
         * Current managed-agent revision, when this is a managed seren-agent deployment.
         */
        active_revision_id?: string | null;
        alert_policy?: null | CloudDeploymentAlertPolicy;
        code_bundle_hash: string;
        compute_backend: CloudDeploymentComputeBackend;
        created_at: string;
        cron_schedule?: string | null;
        cron_timezone?: string | null;
        dashboard_config?: unknown;
        deployment_bundle_id?: string | null;
        endpoint_url?: string | null;
        environment_id?: string | null;
        error_message?: string | null;
        eval_gate_max_age_seconds?: number | null;
        eval_gate_set_id?: string | null;
        eval_gate_status?: null | CloudDeploymentEvalGateStatus;
        id: string;
        managed_agent?: null | ManagedAgentSummary;
        mode: CloudDeploymentMode;
        model_id?: string | null;
        name: string;
        network_policy?: null | CloudDeploymentNetworkPolicy;
        orchestration_mode: OrchestrationMode;
        organization_id: string;
        publisher_only?: boolean;
        requirements: unknown;
        runtime_kind: CloudDeploymentRuntimeKind;
        skill_slug: string;
        status: CloudDeploymentStatus;
        updated_at: string;
        user_id: string;
        /**
         * Visibility mode: "open" (default) or "opaque" (redacts selected details from non-owners).
         */
        visibility: string;
    };
    pagination?: null | PaginationMeta;
};

/**
 * Generic API response wrapper with optional pagination
 *
 * This wrapper provides a consistent structure for all API responses,
 * making it easier for clients to handle responses uniformly. It supports
 * both single resources and collections, with optional pagination metadata.
 * Publisher endpoints use the same wrapper for non-streaming JSON success
 * responses, including first-class publishers. Streaming endpoints such as
 * SSE responses carry metering in response headers and are not wrapped.
 * Payment-required and error responses are also not wrapped so clients can
 * parse their existing wire contracts directly.
 *
 * # Response Structure
 *
 * ```json
 * {
 * "data": T,
 * "pagination": { ... } // optional
 * }
 * ```
 *
 * # Examples
 *
 * ## Single Resource
 *
 * ```rust
 * use seren_core::http::DataResponse;
 * use serde::Serialize;
 *
 * #[derive(Serialize)]
 * struct Project {
 * id: String,
 * name: String,
 * }
 *
 * let project = Project {
 * id: "123".to_string(),
 * name: "My Project".to_string(),
 * };
 *
 * let response = DataResponse::new(project);
 * // Serializes to: {"data": {"id": "123", "name": "My Project"}}
 * ```
 *
 * ## Collection with Pagination
 *
 * ```rust
 * use seren_core::http::DataResponse;
 * use seren_core::pagination::PaginationMeta;
 * use serde::Serialize;
 *
 * #[derive(Serialize)]
 * struct Project {
 * id: String,
 * name: String,
 * }
 *
 * let projects: Vec<Project> = Vec::new();
 * let pagination = PaginationMeta {
 * total: 0,
 * count: 0,
 * limit: 20,
 * offset: 0,
 * has_more: false,
 * };
 *
 * let response = DataResponse::with_pagination(projects, pagination);
 * // Serializes to: {"data": [...], "pagination": {"total": 0, "count": 0, "limit": 20, "offset": 0, "has_more": false}}
 * ```
 */
export type DataResponseManagedAgentDeploymentDetail = {
    data: {
        /**
         * Current managed-agent revision for this deployment.
         */
        active_revision_id?: string | null;
        agent_slug: string;
        alert_policy?: null | CloudDeploymentAlertPolicy;
        allowed_publisher_operations: Array<string>;
        allowed_remote_agent_origins?: Array<string>;
        approval_policy: ManagedAgentApprovalPolicy;
        bundle: AgentBundle;
        compute_backend: CloudDeploymentComputeBackend;
        /**
         * Structured status conditions for the managed deployment. Today this is
         * synthesized from the flat lifecycle `status` and the last persisted
         * `error_message`; future work will let the runtime controller report
         * conditions directly.
         */
        conditions?: Array<ManagedDeploymentCondition>;
        config?: unknown;
        context_budget_tokens?: number | null;
        /**
         * Credential references attached to this deployment, when any.
         */
        credentials?: Array<AgentCredentialRef>;
        cron_schedule?: string | null;
        cron_timezone?: string | null;
        dashboard_config?: unknown;
        deployment_id: string;
        eval_gate?: null | EvalGate;
        fallback_models?: Array<string> | null;
        /**
         * Guardrails attached to this deployment, when any.
         */
        guardrails?: Array<AgentGuardrailPolicy>;
        llm_connection?: null | ManagedAgentLlmConnection;
        max_iterations?: number | null;
        max_timeout_seconds?: number | null;
        max_tool_calls_per_run?: number | null;
        max_tool_output_chars?: number | null;
        memory_policy?: null | AgentMemoryPolicy;
        mode: CloudDeploymentMode;
        model_config: unknown;
        model_id: string;
        model_policy: ManagedAgentModelPolicy;
        name: string;
        network_policy?: null | CloudDeploymentNetworkPolicy;
        private_output_policy: ManagedAgentPrivateOutputPolicy;
        requirements: Array<RequirementSpec>;
        resolved_tools: Array<string>;
        routing_reason: string;
        runtime_adapter: ManagedAgentRuntimeAdapter;
        runtime_kind: CloudDeploymentRuntimeKind;
        runtime_policy?: null | AgentRuntimePolicy;
        secret_keys: Array<string>;
        session_database?: null | ManagedAgentSessionDatabase;
        side_effect_policy?: null | SideEffectPolicy;
        status: CloudDeploymentStatus;
        template: ManagedAgentTemplate;
        tool_presets: Array<ManagedAgentToolPreset>;
        /**
         * Typed tool refs declared on the deployment, when any.
         */
        tool_refs?: Array<AgentToolRef>;
        visibility: string;
    };
    pagination?: null | PaginationMeta;
};

/**
 * Generic API response wrapper with optional pagination
 *
 * This wrapper provides a consistent structure for all API responses,
 * making it easier for clients to handle responses uniformly. It supports
 * both single resources and collections, with optional pagination metadata.
 * Publisher endpoints use the same wrapper for non-streaming JSON success
 * responses, including first-class publishers. Streaming endpoints such as
 * SSE responses carry metering in response headers and are not wrapped.
 * Payment-required and error responses are also not wrapped so clients can
 * parse their existing wire contracts directly.
 *
 * # Response Structure
 *
 * ```json
 * {
 * "data": T,
 * "pagination": { ... } // optional
 * }
 * ```
 *
 * # Examples
 *
 * ## Single Resource
 *
 * ```rust
 * use seren_core::http::DataResponse;
 * use serde::Serialize;
 *
 * #[derive(Serialize)]
 * struct Project {
 * id: String,
 * name: String,
 * }
 *
 * let project = Project {
 * id: "123".to_string(),
 * name: "My Project".to_string(),
 * };
 *
 * let response = DataResponse::new(project);
 * // Serializes to: {"data": {"id": "123", "name": "My Project"}}
 * ```
 *
 * ## Collection with Pagination
 *
 * ```rust
 * use seren_core::http::DataResponse;
 * use seren_core::pagination::PaginationMeta;
 * use serde::Serialize;
 *
 * #[derive(Serialize)]
 * struct Project {
 * id: String,
 * name: String,
 * }
 *
 * let projects: Vec<Project> = Vec::new();
 * let pagination = PaginationMeta {
 * total: 0,
 * count: 0,
 * limit: 20,
 * offset: 0,
 * has_more: false,
 * };
 *
 * let response = DataResponse::with_pagination(projects, pagination);
 * // Serializes to: {"data": [...], "pagination": {"total": 0, "count": 0, "limit": 20, "offset": 0, "has_more": false}}
 * ```
 */
export type DataResponseManagedAgentDeploymentRollbackPreview = {
    data: {
        changed_fields: Array<ManagedAgentFieldChange>;
        current: ManagedAgentDeploymentDetail;
        deployment_id: string;
        eval_gate_status?: null | CloudDeploymentEvalGateStatus;
        proposed: ManagedAgentDeploymentDetail;
        target_revision: ManagedAgentDeploymentRevisionSummary;
    };
    pagination?: null | PaginationMeta;
};

/**
 * Generic API response wrapper with optional pagination
 *
 * This wrapper provides a consistent structure for all API responses,
 * making it easier for clients to handle responses uniformly. It supports
 * both single resources and collections, with optional pagination metadata.
 * Publisher endpoints use the same wrapper for non-streaming JSON success
 * responses, including first-class publishers. Streaming endpoints such as
 * SSE responses carry metering in response headers and are not wrapped.
 * Payment-required and error responses are also not wrapped so clients can
 * parse their existing wire contracts directly.
 *
 * # Response Structure
 *
 * ```json
 * {
 * "data": T,
 * "pagination": { ... } // optional
 * }
 * ```
 *
 * # Examples
 *
 * ## Single Resource
 *
 * ```rust
 * use seren_core::http::DataResponse;
 * use serde::Serialize;
 *
 * #[derive(Serialize)]
 * struct Project {
 * id: String,
 * name: String,
 * }
 *
 * let project = Project {
 * id: "123".to_string(),
 * name: "My Project".to_string(),
 * };
 *
 * let response = DataResponse::new(project);
 * // Serializes to: {"data": {"id": "123", "name": "My Project"}}
 * ```
 *
 * ## Collection with Pagination
 *
 * ```rust
 * use seren_core::http::DataResponse;
 * use seren_core::pagination::PaginationMeta;
 * use serde::Serialize;
 *
 * #[derive(Serialize)]
 * struct Project {
 * id: String,
 * name: String,
 * }
 *
 * let projects: Vec<Project> = Vec::new();
 * let pagination = PaginationMeta {
 * total: 0,
 * count: 0,
 * limit: 20,
 * offset: 0,
 * has_more: false,
 * };
 *
 * let response = DataResponse::with_pagination(projects, pagination);
 * // Serializes to: {"data": [...], "pagination": {"total": 0, "count": 0, "limit": 20, "offset": 0, "has_more": false}}
 * ```
 */
export type DataResponseManagedAgentDeploymentUpdatePreview = {
    data: {
        changed_fields: Array<ManagedAgentFieldChange>;
        current: ManagedAgentDeploymentDetail;
        deployment_id: string;
        eval_gate_status?: null | CloudDeploymentEvalGateStatus;
        proposed: ManagedAgentDeploymentDetail;
    };
    pagination?: null | PaginationMeta;
};

/**
 * Generic API response wrapper with optional pagination
 *
 * This wrapper provides a consistent structure for all API responses,
 * making it easier for clients to handle responses uniformly. It supports
 * both single resources and collections, with optional pagination metadata.
 * Publisher endpoints use the same wrapper for non-streaming JSON success
 * responses, including first-class publishers. Streaming endpoints such as
 * SSE responses carry metering in response headers and are not wrapped.
 * Payment-required and error responses are also not wrapped so clients can
 * parse their existing wire contracts directly.
 *
 * # Response Structure
 *
 * ```json
 * {
 * "data": T,
 * "pagination": { ... } // optional
 * }
 * ```
 *
 * # Examples
 *
 * ## Single Resource
 *
 * ```rust
 * use seren_core::http::DataResponse;
 * use serde::Serialize;
 *
 * #[derive(Serialize)]
 * struct Project {
 * id: String,
 * name: String,
 * }
 *
 * let project = Project {
 * id: "123".to_string(),
 * name: "My Project".to_string(),
 * };
 *
 * let response = DataResponse::new(project);
 * // Serializes to: {"data": {"id": "123", "name": "My Project"}}
 * ```
 *
 * ## Collection with Pagination
 *
 * ```rust
 * use seren_core::http::DataResponse;
 * use seren_core::pagination::PaginationMeta;
 * use serde::Serialize;
 *
 * #[derive(Serialize)]
 * struct Project {
 * id: String,
 * name: String,
 * }
 *
 * let projects: Vec<Project> = Vec::new();
 * let pagination = PaginationMeta {
 * total: 0,
 * count: 0,
 * limit: 20,
 * offset: 0,
 * has_more: false,
 * };
 *
 * let response = DataResponse::with_pagination(projects, pagination);
 * // Serializes to: {"data": [...], "pagination": {"total": 0, "count": 0, "limit": 20, "offset": 0, "has_more": false}}
 * ```
 */
export type DataResponsePrivateModelCatalogResponse = {
    data: {
        catalog_source: PrivateModelCatalogSource;
        default_model_id: string;
        models: Array<PrivateModelCatalogEntry>;
        notice?: string | null;
        supports_custom_model_id: boolean;
    };
    pagination?: null | PaginationMeta;
};

/**
 * Generic API response wrapper with optional pagination
 *
 * This wrapper provides a consistent structure for all API responses,
 * making it easier for clients to handle responses uniformly. It supports
 * both single resources and collections, with optional pagination metadata.
 * Publisher endpoints use the same wrapper for non-streaming JSON success
 * responses, including first-class publishers. Streaming endpoints such as
 * SSE responses carry metering in response headers and are not wrapped.
 * Payment-required and error responses are also not wrapped so clients can
 * parse their existing wire contracts directly.
 *
 * # Response Structure
 *
 * ```json
 * {
 * "data": T,
 * "pagination": { ... } // optional
 * }
 * ```
 *
 * # Examples
 *
 * ## Single Resource
 *
 * ```rust
 * use seren_core::http::DataResponse;
 * use serde::Serialize;
 *
 * #[derive(Serialize)]
 * struct Project {
 * id: String,
 * name: String,
 * }
 *
 * let project = Project {
 * id: "123".to_string(),
 * name: "My Project".to_string(),
 * };
 *
 * let response = DataResponse::new(project);
 * // Serializes to: {"data": {"id": "123", "name": "My Project"}}
 * ```
 *
 * ## Collection with Pagination
 *
 * ```rust
 * use seren_core::http::DataResponse;
 * use seren_core::pagination::PaginationMeta;
 * use serde::Serialize;
 *
 * #[derive(Serialize)]
 * struct Project {
 * id: String,
 * name: String,
 * }
 *
 * let projects: Vec<Project> = Vec::new();
 * let pagination = PaginationMeta {
 * total: 0,
 * count: 0,
 * limit: 20,
 * offset: 0,
 * has_more: false,
 * };
 *
 * let response = DataResponse::with_pagination(projects, pagination);
 * // Serializes to: {"data": [...], "pagination": {"total": 0, "count": 0, "limit": 20, "offset": 0, "has_more": false}}
 * ```
 */
export type DataResponseTestSerenAgentDraftRunResponse = {
    data: {
        error?: string | null;
        error_info?: unknown;
        iterations: number;
        output_events: Array<unknown>;
        partial_response?: string | null;
        response?: string | null;
        runtime_adapter: string;
        status: ManagedAgentDraftTestRunStatus;
        tool_calls: Array<unknown>;
        usage: unknown;
        warnings?: Array<string>;
        workflow?: unknown;
    };
    pagination?: null | PaginationMeta;
};

/**
 * Generic API response wrapper with optional pagination
 *
 * This wrapper provides a consistent structure for all API responses,
 * making it easier for clients to handle responses uniformly. It supports
 * both single resources and collections, with optional pagination metadata.
 * Publisher endpoints use the same wrapper for non-streaming JSON success
 * responses, including first-class publishers. Streaming endpoints such as
 * SSE responses carry metering in response headers and are not wrapped.
 * Payment-required and error responses are also not wrapped so clients can
 * parse their existing wire contracts directly.
 *
 * # Response Structure
 *
 * ```json
 * {
 * "data": T,
 * "pagination": { ... } // optional
 * }
 * ```
 *
 * # Examples
 *
 * ## Single Resource
 *
 * ```rust
 * use seren_core::http::DataResponse;
 * use serde::Serialize;
 *
 * #[derive(Serialize)]
 * struct Project {
 * id: String,
 * name: String,
 * }
 *
 * let project = Project {
 * id: "123".to_string(),
 * name: "My Project".to_string(),
 * };
 *
 * let response = DataResponse::new(project);
 * // Serializes to: {"data": {"id": "123", "name": "My Project"}}
 * ```
 *
 * ## Collection with Pagination
 *
 * ```rust
 * use seren_core::http::DataResponse;
 * use seren_core::pagination::PaginationMeta;
 * use serde::Serialize;
 *
 * #[derive(Serialize)]
 * struct Project {
 * id: String,
 * name: String,
 * }
 *
 * let projects: Vec<Project> = Vec::new();
 * let pagination = PaginationMeta {
 * total: 0,
 * count: 0,
 * limit: 20,
 * offset: 0,
 * has_more: false,
 * };
 *
 * let response = DataResponse::with_pagination(projects, pagination);
 * // Serializes to: {"data": [...], "pagination": {"total": 0, "count": 0, "limit": 20, "offset": 0, "has_more": false}}
 * ```
 */
export type DataResponseVecCloudDeploymentSummary = {
    data: Array<{
        /**
         * Current managed-agent revision, when this is a managed seren-agent deployment.
         */
        active_revision_id?: string | null;
        alert_policy?: null | CloudDeploymentAlertPolicy;
        code_bundle_hash: string;
        compute_backend: CloudDeploymentComputeBackend;
        created_at: string;
        cron_schedule?: string | null;
        cron_timezone?: string | null;
        dashboard_config?: unknown;
        deployment_bundle_id?: string | null;
        endpoint_url?: string | null;
        environment_id?: string | null;
        error_message?: string | null;
        eval_gate_max_age_seconds?: number | null;
        eval_gate_set_id?: string | null;
        eval_gate_status?: null | CloudDeploymentEvalGateStatus;
        id: string;
        managed_agent?: null | ManagedAgentSummary;
        mode: CloudDeploymentMode;
        model_id?: string | null;
        name: string;
        network_policy?: null | CloudDeploymentNetworkPolicy;
        orchestration_mode: OrchestrationMode;
        organization_id: string;
        publisher_only?: boolean;
        requirements: unknown;
        runtime_kind: CloudDeploymentRuntimeKind;
        skill_slug: string;
        status: CloudDeploymentStatus;
        updated_at: string;
        user_id: string;
        /**
         * Visibility mode: "open" (default) or "opaque" (redacts selected details from non-owners).
         */
        visibility: string;
    }>;
    pagination?: null | PaginationMeta;
};

/**
 * Generic API response wrapper with optional pagination
 *
 * This wrapper provides a consistent structure for all API responses,
 * making it easier for clients to handle responses uniformly. It supports
 * both single resources and collections, with optional pagination metadata.
 * Publisher endpoints use the same wrapper for non-streaming JSON success
 * responses, including first-class publishers. Streaming endpoints such as
 * SSE responses carry metering in response headers and are not wrapped.
 * Payment-required and error responses are also not wrapped so clients can
 * parse their existing wire contracts directly.
 *
 * # Response Structure
 *
 * ```json
 * {
 * "data": T,
 * "pagination": { ... } // optional
 * }
 * ```
 *
 * # Examples
 *
 * ## Single Resource
 *
 * ```rust
 * use seren_core::http::DataResponse;
 * use serde::Serialize;
 *
 * #[derive(Serialize)]
 * struct Project {
 * id: String,
 * name: String,
 * }
 *
 * let project = Project {
 * id: "123".to_string(),
 * name: "My Project".to_string(),
 * };
 *
 * let response = DataResponse::new(project);
 * // Serializes to: {"data": {"id": "123", "name": "My Project"}}
 * ```
 *
 * ## Collection with Pagination
 *
 * ```rust
 * use seren_core::http::DataResponse;
 * use seren_core::pagination::PaginationMeta;
 * use serde::Serialize;
 *
 * #[derive(Serialize)]
 * struct Project {
 * id: String,
 * name: String,
 * }
 *
 * let projects: Vec<Project> = Vec::new();
 * let pagination = PaginationMeta {
 * total: 0,
 * count: 0,
 * limit: 20,
 * offset: 0,
 * has_more: false,
 * };
 *
 * let response = DataResponse::with_pagination(projects, pagination);
 * // Serializes to: {"data": [...], "pagination": {"total": 0, "count": 0, "limit": 20, "offset": 0, "has_more": false}}
 * ```
 */
export type DataResponseVecManagedAgentDeploymentRevisionSummary = {
    data: Array<{
        agent_slug: string;
        approval_policy: ManagedAgentApprovalPolicy;
        change_kind: ManagedAgentRevisionChangeKind;
        change_summary: Array<string>;
        changed_fields: Array<string>;
        created_at: string;
        created_by_user_id: string;
        deployment_id: string;
        model_id: string;
        model_policy: ManagedAgentModelPolicy;
        name: string;
        restored_from_revision_id?: string | null;
        revision_id: string;
        template: ManagedAgentTemplate;
        version: number;
    }>;
    pagination?: null | PaginationMeta;
};

/**
 * Eval gate configuration that must pass with a fresh verdict before runs proceed.
 *
 * `block_on_failure` controls what happens at update or rollback apply time:
 * when `Some(true)`, the control plane rejects the apply if the latest eval
 * verdict has failed or has expired beyond `max_age_seconds`. The default
 * (`None`/`false`) preserves the original freshness-only behavior for
 * back-compat.
 *
 * `schedule` is an operator-supplied cron expression that asks the control
 * plane to run the gated eval set on a fixed cadence so freshness stays
 * current without manual triggering. The actual scheduling-loop dispatch is
 * owned by the eval-set scheduler today (see `CloudEvalSetSchedule`); this
 * field records the operator intent on the deployment side.
 *
 * `drift_baseline` is captured by the apply path when an update or rollback
 * commits with a passing gate. Subsequent eval runs compare against the
 * baseline so operators see regressions explicitly.
 */
export type EvalGate = {
    block_on_failure?: boolean | null;
    drift_baseline?: null | EvalGateDriftBaseline;
    max_age_seconds: number;
    schedule?: null | EvalGateSchedule;
    set_id: string;
};

/**
 * Snapshot of an eval-set verdict captured at the last successful apply.
 * Subsequent eval runs (manual or scheduled) compare against this snapshot
 * to surface drift; the apply path overwrites this value on every commit.
 */
export type EvalGateDriftBaseline = {
    baseline_captured_at: string;
    baseline_failed: number;
    baseline_passed: number;
    baseline_run_id: string;
    baseline_set_id: string;
};

/**
 * Cron-driven cadence requested by the operator for an eval gate. The
 * timezone is an IANA name (e.g. `UTC`, `America/New_York`); when omitted the
 * control plane defaults to UTC.
 */
export type EvalGateSchedule = {
    /**
     * Standard 5-field cron expression. Validated against the same parser
     * that backs deployment cron schedules.
     */
    cron: string;
    /**
     * Optional IANA timezone. Defaults to `UTC` when absent.
     */
    timezone?: string | null;
};

/**
 * Capability granted by an `ActionLease`. `All` grants every sub-action of
 * the named action; `Specific` enumerates a closed set.
 */
export type GrantedActions = {
    kind: 'all';
} | {
    actions: Array<string>;
    kind: 'specific';
};

export type ManagedAgentApprovalPolicy = 'read_only' | 'allow_mutations';

export type ManagedAgentDeploymentDetail = {
    /**
     * Current managed-agent revision for this deployment.
     */
    active_revision_id?: string | null;
    agent_slug: string;
    alert_policy?: null | CloudDeploymentAlertPolicy;
    allowed_publisher_operations: Array<string>;
    allowed_remote_agent_origins?: Array<string>;
    approval_policy: ManagedAgentApprovalPolicy;
    bundle: AgentBundle;
    compute_backend: CloudDeploymentComputeBackend;
    /**
     * Structured status conditions for the managed deployment. Today this is
     * synthesized from the flat lifecycle `status` and the last persisted
     * `error_message`; future work will let the runtime controller report
     * conditions directly.
     */
    conditions?: Array<ManagedDeploymentCondition>;
    config?: unknown;
    context_budget_tokens?: number | null;
    /**
     * Credential references attached to this deployment, when any.
     */
    credentials?: Array<AgentCredentialRef>;
    cron_schedule?: string | null;
    cron_timezone?: string | null;
    dashboard_config?: unknown;
    deployment_id: string;
    eval_gate?: null | EvalGate;
    fallback_models?: Array<string> | null;
    /**
     * Guardrails attached to this deployment, when any.
     */
    guardrails?: Array<AgentGuardrailPolicy>;
    llm_connection?: null | ManagedAgentLlmConnection;
    max_iterations?: number | null;
    max_timeout_seconds?: number | null;
    max_tool_calls_per_run?: number | null;
    max_tool_output_chars?: number | null;
    memory_policy?: null | AgentMemoryPolicy;
    mode: CloudDeploymentMode;
    model_config: unknown;
    model_id: string;
    model_policy: ManagedAgentModelPolicy;
    name: string;
    network_policy?: null | CloudDeploymentNetworkPolicy;
    private_output_policy: ManagedAgentPrivateOutputPolicy;
    requirements: Array<RequirementSpec>;
    resolved_tools: Array<string>;
    routing_reason: string;
    runtime_adapter: ManagedAgentRuntimeAdapter;
    runtime_kind: CloudDeploymentRuntimeKind;
    runtime_policy?: null | AgentRuntimePolicy;
    secret_keys: Array<string>;
    session_database?: null | ManagedAgentSessionDatabase;
    side_effect_policy?: null | SideEffectPolicy;
    status: CloudDeploymentStatus;
    template: ManagedAgentTemplate;
    tool_presets: Array<ManagedAgentToolPreset>;
    /**
     * Typed tool refs declared on the deployment, when any.
     */
    tool_refs?: Array<AgentToolRef>;
    visibility: string;
};

export type ManagedAgentDeploymentRevisionSummary = {
    agent_slug: string;
    approval_policy: ManagedAgentApprovalPolicy;
    change_kind: ManagedAgentRevisionChangeKind;
    change_summary: Array<string>;
    changed_fields: Array<string>;
    created_at: string;
    created_by_user_id: string;
    deployment_id: string;
    model_id: string;
    model_policy: ManagedAgentModelPolicy;
    name: string;
    restored_from_revision_id?: string | null;
    revision_id: string;
    template: ManagedAgentTemplate;
    version: number;
};

export type ManagedAgentDeploymentRollbackPreview = {
    changed_fields: Array<ManagedAgentFieldChange>;
    current: ManagedAgentDeploymentDetail;
    deployment_id: string;
    eval_gate_status?: null | CloudDeploymentEvalGateStatus;
    proposed: ManagedAgentDeploymentDetail;
    target_revision: ManagedAgentDeploymentRevisionSummary;
};

export type ManagedAgentDeploymentUpdatePreview = {
    changed_fields: Array<ManagedAgentFieldChange>;
    current: ManagedAgentDeploymentDetail;
    deployment_id: string;
    eval_gate_status?: null | CloudDeploymentEvalGateStatus;
    proposed: ManagedAgentDeploymentDetail;
};

export type ManagedAgentDraftTestRunStatus = 'completed' | 'awaiting_approval' | 'failed';

export type ManagedAgentFieldChange = {
    current_value: unknown;
    field: string;
    label: string;
    proposed_value: unknown;
};

export type ManagedAgentLlmConnection = {
    provider: 'seren_private_models';
};

export type ManagedAgentModelPolicy = 'fast' | 'balanced' | 'deep';

export type ManagedAgentPrivateOutputPolicy = 'control_plane' | 'private_session_database';

export type ManagedAgentRevisionChangeKind = 'create' | 'update' | 'rollback';

export type ManagedAgentRuntimeAdapter = 'adk';

export type ManagedAgentSessionDatabase = {
    /**
     * Optional Seren organization database name when `provider` is `seren_organization_database`.
     */
    database_name?: string | null;
    /**
     * Session database engine family. The runtime still consumes a standard connection URL.
     */
    engine: ManagedAgentSessionDatabaseEngine;
    /**
     * Session database provider. Defaults to `direct_url`.
     */
    provider?: ManagedAgentSessionDatabaseProvider;
    /**
     * Secret key whose value is the connection URL for the session database.
     */
    url_secret_key?: string | null;
};

export type ManagedAgentSessionDatabaseEngine = 'postgres' | 'aurora_postgres';

export type ManagedAgentSessionDatabaseProvider = 'direct_url' | 'seren_organization_database';

export type ManagedAgentSummary = {
    allowed_publisher_operations: Array<string>;
    allowed_remote_agent_origins?: Array<string>;
    approval_policy: ManagedAgentApprovalPolicy;
    build_target: string;
    model_policy: ManagedAgentModelPolicy;
    publisher: string;
    resolved_tools: Array<string>;
    routing_reason: string;
    runtime_adapter: string;
    target_framework: string;
    template: ManagedAgentTemplate;
    tool_presets: Array<ManagedAgentToolPreset>;
};

export type ManagedAgentTemplate = 'research_monitor' | 'workflow_agent';

export type ManagedAgentToolPreset = 'live_data' | 'publisher_actions' | 'database';

/**
 * Structured condition reported on a managed deployment's status. Mirrors the
 * shape of `metav1.Condition` (Kubernetes) in our own DTOs without importing
 * the Kubernetes types into the public API. Each condition has a typed
 * `type`, a tri-state `status`, and human-readable `reason`/`message` fields.
 */
export type ManagedDeploymentCondition = {
    /**
     * Timestamp of the most recent transition into the current `status`.
     */
    last_transition_time?: string | null;
    /**
     * Human-readable explanation; safe to surface in operator UI.
     */
    message?: string | null;
    /**
     * Short token describing why the condition has its current status.
     */
    reason?: string | null;
    status: ManagedDeploymentConditionState;
    type: ManagedDeploymentConditionType;
};

/**
 * Tri-state condition value. Mirrors Kubernetes condition status.
 */
export type ManagedDeploymentConditionState = 'True' | 'False' | 'Unknown';

/**
 * Closed set of managed-deployment condition types. New types should be added
 * here only when there is a clear semantic, not for ad-hoc operator messages.
 */
export type ManagedDeploymentConditionType = 'Accepted' | 'Ready' | 'AwaitingApproval' | 'PolicyDenied' | 'ImagePullFailed' | 'ConfigFetchFailed' | 'ReadinessProbeFailed' | 'Suspended' | 'Expired' | 'Failed';

/**
 * Cloud deployment orchestration mode.
 *
 * `Script` (default): container runs user code directly (existing behavior).
 * `Llm`: container runs the seren-orchestrator LLM tool-calling loop.
 */
export type OrchestrationMode = 'script' | 'llm';

/**
 * Pagination metadata included in responses.
 */
export type PaginationMeta = {
    /**
     * Number of items in this response
     */
    count: number;
    /**
     * Whether there are more items after this page
     */
    has_more: boolean;
    /**
     * Maximum items per page
     */
    limit: number;
    /**
     * Offset from start
     */
    offset: number;
    /**
     * Total number of items across all pages
     */
    total: number;
};

export type PrivateModelCatalogEntry = {
    label: string;
    model_id: string;
    recommended: boolean;
};

export type PrivateModelCatalogResponse = {
    catalog_source: PrivateModelCatalogSource;
    default_model_id: string;
    models: Array<PrivateModelCatalogEntry>;
    notice?: string | null;
    supports_custom_model_id: boolean;
};

export type PrivateModelCatalogSource = 'live_discovery' | 'fallback_registry' | 'unsupported_provider';

/**
 * Where a deployment requirement should be satisfied from.
 */
export type RequirementSource = 'env' | 'secret' | 'config';

/**
 * A declared requirement for a cloud deployment (validated at deploy time).
 */
export type RequirementSpec = {
    description?: string | null;
    key: string;
    source: RequirementSource;
};

export type RollbackSerenAgentDeploymentRequest = {
    revision_id: string;
};

/**
 * Deployment-level safety controls for mutating built-in publisher calls.
 */
export type SideEffectPolicy = {
    max_mutating_calls_per_run?: number | null;
    min_seconds_between_mutating_calls?: number | null;
    require_idempotency_key?: boolean;
};

export type TestSerenAgentDraftRunRequest = {
    /**
     * Draft managed-agent deployment spec to test.
     */
    deployment: AgentSpec;
    /**
     * Optional test message. When omitted, the server uses a generic first-run prompt.
     */
    message?: string | null;
};

export type TestSerenAgentDraftRunResponse = {
    error?: string | null;
    error_info?: unknown;
    iterations: number;
    output_events: Array<unknown>;
    partial_response?: string | null;
    response?: string | null;
    runtime_adapter: string;
    status: ManagedAgentDraftTestRunStatus;
    tool_calls: Array<unknown>;
    usage: unknown;
    warnings?: Array<string>;
    workflow?: unknown;
};

/**
 * Condition for a conditional approval rule.
 */
export type ToolApprovalCondition = {
    gte?: number | null;
    lte?: number | null;
    path: string;
    type: 'numeric_threshold';
} | {
    path: string;
    type: 'string_equals';
    value: string;
} | {
    path: string;
    type: 'string_in';
    values: Array<string>;
} | {
    path: string;
    type: 'string_not_in';
    values: Array<string>;
} | {
    path: string;
    type: 'boolean_equals';
    value: boolean;
} | {
    end_hour: number;
    start_hour: number;
    type: 'outside_hours_utc';
};

/**
 * Conditional approval rule for an orchestration tool.
 */
export type ToolApprovalRule = {
    approval_reason?: string | null;
    approval_type?: ToolApprovalType;
    conditions?: Array<ToolApprovalCondition>;
};

/**
 * Approval policy for an LLM orchestration tool.
 */
export type ToolApprovalType = 'none' | 'required' | 'audit';

/**
 * A single tool definition for LLM orchestration.
 */
export type ToolDefinition = {
    approval_reason?: string | null;
    approval_rules?: Array<ToolApprovalRule>;
    approval_type?: ToolApprovalType;
    description: string;
    input_schema?: unknown;
    /**
     * Maximum output size in bytes for this tool. Output exceeding this limit is truncated.
     */
    max_output_bytes?: number | null;
    name: string;
    /**
     * Per-tool timeout override in seconds. Overrides the deployment-level tool timeout.
     */
    timeout_override_seconds?: number | null;
};

/**
 * Execution strategy for a workload.
 *
 * Tagged on the `type` field so the wire shape is `{"type":"llm",...}` or
 * `{"type":"code",...}`.
 */
export type WorkloadExecution = {
    adapter?: null | ManagedAgentRuntimeAdapter;
    /**
     * Authored instruction and asset files for the LLM agent.
     */
    bundle: AgentBundle;
    /**
     * Ordered list of fallback model identifiers tried on primary failure.
     */
    fallback_models?: Array<string> | null;
    llm_connection?: null | ManagedAgentLlmConnection;
    /**
     * Arbitrary model parameters forwarded to the provider.
     */
    model_config?: unknown;
    /**
     * Model identifier override (e.g. `"anthropic/claude-sonnet-4.6"`).
     */
    model_id?: string | null;
    /**
     * Tool definitions available to the LLM during execution.
     */
    tool_definitions?: Array<ToolDefinition> | null;
    type: 'llm';
} | {
    /**
     * Uploaded deployment bundle identifier returned by `seren_cloud_create_deployment_bundle`.
     */
    deployment_bundle_id: string;
    /**
     * Python requirements.txt contents injected at build time.
     */
    requirements_txt?: string | null;
    runtime_kind?: null | CloudDeploymentRuntimeKind;
    type: 'code';
};

/**
 * Resource and iteration limits applied to a workload run.
 *
 * All fields default to `None` (no limit).
 */
export type WorkloadLimits = {
    /**
     * Maximum context window budget in tokens.
     */
    context_budget_tokens?: number | null;
    /**
     * Maximum number of agent loop iterations before the run is terminated.
     */
    max_iterations?: number | null;
    /**
     * Wall-clock timeout in seconds for the entire run.
     */
    max_timeout_seconds?: number | null;
    /**
     * Maximum number of tool calls across the entire run.
     */
    max_tool_calls_per_run?: number | null;
    /**
     * Maximum number of characters kept from any single tool output.
     */
    max_tool_output_chars?: number | null;
};

/**
 * Full runtime specification for a cloud workload.
 *
 * Captures compute backend, network policy, side-effect controls, and the
 * execution discriminator. The `execution` field is required; all other
 * fields default to `None` or their zero value.
 */
export type WorkloadSpec = {
    compute_backend?: null | CloudDeploymentComputeBackend;
    /**
     * Arbitrary operator-supplied configuration passed to the runtime.
     */
    config?: unknown;
    /**
     * Execution strategy -- either LLM-orchestrated or artifact-bundle backed.
     */
    execution: WorkloadExecution;
    /**
     * Resource and iteration limits for the workload.
     */
    limits?: WorkloadLimits;
    network_policy?: null | CloudDeploymentNetworkPolicy;
    /**
     * When true, the workload is exposed only through publisher-managed entry points.
     */
    publisher_only?: boolean;
    /**
     * Declared requirements validated at deploy time.
     */
    requirements?: Array<RequirementSpec> | null;
    /**
     * Secret references available to the runtime.
     */
    secrets?: unknown;
    side_effect_policy?: null | SideEffectPolicy;
};

export type SerenAgentCapabilitiesData = {
    body?: never;
    path?: never;
    query?: never;
    url: '/capabilities';
};

export type SerenAgentCapabilitiesResponses = {
    /**
     * Capabilities retrieved
     */
    200: DataResponseAgentCapabilitiesResponse;
};

export type SerenAgentCapabilitiesResponse = SerenAgentCapabilitiesResponses[keyof SerenAgentCapabilitiesResponses];

export type SerenAgentDeployData = {
    body: AgentSpec;
    path?: never;
    query?: never;
    url: '/deploy';
};

export type SerenAgentDeployErrors = {
    /**
     * Bad request
     */
    400: unknown;
    /**
     * Unauthorized
     */
    401: unknown;
};

export type SerenAgentDeployResponses = {
    /**
     * Deployment accepted
     */
    202: DataResponseCloudDeploymentSummary;
};

export type SerenAgentDeployResponse = SerenAgentDeployResponses[keyof SerenAgentDeployResponses];

export type SerenAgentListDeploymentsData = {
    body?: never;
    path?: never;
    query?: never;
    url: '/deployments';
};

export type SerenAgentListDeploymentsErrors = {
    /**
     * Unauthorized
     */
    401: unknown;
};

export type SerenAgentListDeploymentsResponses = {
    /**
     * Deployments listed
     */
    200: DataResponseVecCloudDeploymentSummary;
};

export type SerenAgentListDeploymentsResponse = SerenAgentListDeploymentsResponses[keyof SerenAgentListDeploymentsResponses];

export type SerenAgentDeleteManagedDeploymentData = {
    body?: never;
    path: {
        /**
         * Deployment ID
         */
        id: string;
    };
    query?: never;
    url: '/deployments/{id}';
};

export type SerenAgentDeleteManagedDeploymentErrors = {
    /**
     * Bad request
     */
    400: unknown;
    /**
     * Deployment not found
     */
    404: unknown;
};

export type SerenAgentDeleteManagedDeploymentResponses = {
    /**
     * Managed deployment deleted
     */
    200: DataResponseCloudDeploymentActionStatusResponse;
};

export type SerenAgentDeleteManagedDeploymentResponse = SerenAgentDeleteManagedDeploymentResponses[keyof SerenAgentDeleteManagedDeploymentResponses];

export type SerenAgentGetManagedDeploymentData = {
    body?: never;
    path: {
        /**
         * Deployment ID
         */
        id: string;
    };
    query?: never;
    url: '/deployments/{id}/managed';
};

export type SerenAgentGetManagedDeploymentErrors = {
    /**
     * Managed deployment is opaque to this caller
     */
    403: unknown;
    /**
     * Deployment not found
     */
    404: unknown;
};

export type SerenAgentGetManagedDeploymentResponses = {
    /**
     * Managed deployment detail retrieved
     */
    200: DataResponseManagedAgentDeploymentDetail;
};

export type SerenAgentGetManagedDeploymentResponse = SerenAgentGetManagedDeploymentResponses[keyof SerenAgentGetManagedDeploymentResponses];

export type SerenAgentUpdateManagedDeploymentData = {
    body: AgentSpecUpdate;
    path: {
        /**
         * Deployment ID
         */
        id: string;
    };
    query?: never;
    url: '/deployments/{id}/managed';
};

export type SerenAgentUpdateManagedDeploymentErrors = {
    /**
     * Bad request
     */
    400: unknown;
    /**
     * Managed deployment is opaque to this caller
     */
    403: unknown;
    /**
     * Deployment not found
     */
    404: unknown;
};

export type SerenAgentUpdateManagedDeploymentResponses = {
    /**
     * Managed deployment updated
     */
    200: DataResponseCloudDeploymentSummary;
};

export type SerenAgentUpdateManagedDeploymentResponse = SerenAgentUpdateManagedDeploymentResponses[keyof SerenAgentUpdateManagedDeploymentResponses];

export type SerenAgentPatchManagedDeploymentFilesData = {
    body: AgentBundlePatch;
    path: {
        /**
         * Deployment ID
         */
        id: string;
    };
    query?: never;
    url: '/deployments/{id}/managed/files';
};

export type SerenAgentPatchManagedDeploymentFilesErrors = {
    /**
     * Bad request
     */
    400: unknown;
    /**
     * Managed deployment is opaque to this caller
     */
    403: unknown;
    /**
     * Deployment not found
     */
    404: unknown;
};

export type SerenAgentPatchManagedDeploymentFilesResponses = {
    /**
     * Managed deployment files updated
     */
    200: DataResponseCloudDeploymentSummary;
};

export type SerenAgentPatchManagedDeploymentFilesResponse = SerenAgentPatchManagedDeploymentFilesResponses[keyof SerenAgentPatchManagedDeploymentFilesResponses];

export type SerenAgentPreviewManagedDeploymentUpdateData = {
    body: AgentSpecUpdate;
    path: {
        /**
         * Deployment ID
         */
        id: string;
    };
    query?: never;
    url: '/deployments/{id}/managed/preview';
};

export type SerenAgentPreviewManagedDeploymentUpdateErrors = {
    /**
     * Bad request
     */
    400: unknown;
    /**
     * Managed deployment is opaque to this caller
     */
    403: unknown;
    /**
     * Deployment not found
     */
    404: unknown;
};

export type SerenAgentPreviewManagedDeploymentUpdateResponses = {
    /**
     * Managed deployment update preview
     */
    200: DataResponseManagedAgentDeploymentUpdatePreview;
};

export type SerenAgentPreviewManagedDeploymentUpdateResponse = SerenAgentPreviewManagedDeploymentUpdateResponses[keyof SerenAgentPreviewManagedDeploymentUpdateResponses];

export type SerenAgentListManagedDeploymentRevisionsData = {
    body?: never;
    path: {
        /**
         * Deployment ID
         */
        id: string;
    };
    query?: never;
    url: '/deployments/{id}/managed/revisions';
};

export type SerenAgentListManagedDeploymentRevisionsErrors = {
    /**
     * Managed deployment is opaque to this caller
     */
    403: unknown;
    /**
     * Deployment not found
     */
    404: unknown;
};

export type SerenAgentListManagedDeploymentRevisionsResponses = {
    /**
     * Managed deployment revisions listed
     */
    200: DataResponseVecManagedAgentDeploymentRevisionSummary;
};

export type SerenAgentListManagedDeploymentRevisionsResponse = SerenAgentListManagedDeploymentRevisionsResponses[keyof SerenAgentListManagedDeploymentRevisionsResponses];

export type SerenAgentRollbackManagedDeploymentData = {
    body: RollbackSerenAgentDeploymentRequest;
    path: {
        /**
         * Deployment ID
         */
        id: string;
    };
    query?: never;
    url: '/deployments/{id}/managed/rollback';
};

export type SerenAgentRollbackManagedDeploymentErrors = {
    /**
     * Bad request
     */
    400: unknown;
    /**
     * Managed deployment is opaque to this caller
     */
    403: unknown;
    /**
     * Deployment or revision not found
     */
    404: unknown;
};

export type SerenAgentRollbackManagedDeploymentResponses = {
    /**
     * Managed deployment rolled back
     */
    200: DataResponseCloudDeploymentSummary;
};

export type SerenAgentRollbackManagedDeploymentResponse = SerenAgentRollbackManagedDeploymentResponses[keyof SerenAgentRollbackManagedDeploymentResponses];

export type SerenAgentPreviewManagedDeploymentRollbackData = {
    body: RollbackSerenAgentDeploymentRequest;
    path: {
        /**
         * Deployment ID
         */
        id: string;
    };
    query?: never;
    url: '/deployments/{id}/managed/rollback/preview';
};

export type SerenAgentPreviewManagedDeploymentRollbackErrors = {
    /**
     * Bad request
     */
    400: unknown;
    /**
     * Managed deployment is opaque to this caller
     */
    403: unknown;
    /**
     * Deployment or revision not found
     */
    404: unknown;
};

export type SerenAgentPreviewManagedDeploymentRollbackResponses = {
    /**
     * Managed deployment rollback preview
     */
    200: DataResponseManagedAgentDeploymentRollbackPreview;
};

export type SerenAgentPreviewManagedDeploymentRollbackResponse = SerenAgentPreviewManagedDeploymentRollbackResponses[keyof SerenAgentPreviewManagedDeploymentRollbackResponses];

export type SerenAgentStartManagedDeploymentData = {
    body?: never;
    path: {
        /**
         * Deployment ID
         */
        id: string;
    };
    query?: never;
    url: '/deployments/{id}/start';
};

export type SerenAgentStartManagedDeploymentErrors = {
    /**
     * Bad request
     */
    400: unknown;
    /**
     * Deployment not found
     */
    404: unknown;
};

export type SerenAgentStartManagedDeploymentResponses = {
    /**
     * Managed deployment started
     */
    200: DataResponseCloudDeploymentActionStatusResponse;
};

export type SerenAgentStartManagedDeploymentResponse = SerenAgentStartManagedDeploymentResponses[keyof SerenAgentStartManagedDeploymentResponses];

export type SerenAgentStopManagedDeploymentData = {
    body?: never;
    path: {
        /**
         * Deployment ID
         */
        id: string;
    };
    query?: never;
    url: '/deployments/{id}/stop';
};

export type SerenAgentStopManagedDeploymentErrors = {
    /**
     * Bad request
     */
    400: unknown;
    /**
     * Deployment not found
     */
    404: unknown;
};

export type SerenAgentStopManagedDeploymentResponses = {
    /**
     * Managed deployment stopped
     */
    200: DataResponseCloudDeploymentActionStatusResponse;
};

export type SerenAgentStopManagedDeploymentResponse = SerenAgentStopManagedDeploymentResponses[keyof SerenAgentStopManagedDeploymentResponses];

export type SerenAgentPrivateModelsData = {
    body?: never;
    path?: never;
    query?: {
        /**
         * Optional private model region for live discovery. Defaults to us-east-1.
         */
        region?: string;
    };
    url: '/private-models';
};

export type SerenAgentPrivateModelsResponses = {
    /**
     * Private model catalog retrieved
     */
    200: DataResponsePrivateModelCatalogResponse;
};

export type SerenAgentPrivateModelsResponse = SerenAgentPrivateModelsResponses[keyof SerenAgentPrivateModelsResponses];

export type SerenAgentTestRunData = {
    body: TestSerenAgentDraftRunRequest;
    path?: never;
    query?: never;
    url: '/test-run';
};

export type SerenAgentTestRunErrors = {
    /**
     * Bad request
     */
    400: unknown;
    /**
     * Unauthorized
     */
    401: unknown;
};

export type SerenAgentTestRunResponses = {
    /**
     * Draft test run completed
     */
    200: DataResponseTestSerenAgentDraftRunResponse;
};

export type SerenAgentTestRunResponse = SerenAgentTestRunResponses[keyof SerenAgentTestRunResponses];
