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

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

/**
 * 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>;
};

/**
 * 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;
};

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

/**
 * Lifecycle state of a single inbox entry.
 *
 * The state machine is `pending -> approved | denied | expired`. Decisions are
 * terminal; an entry can never transition from a terminal state back to
 * pending. `expired` is a passive transition driven by `expires_at`.
 */
export type ApprovalDecisionState = 'pending' | 'approved' | 'denied' | 'expired';

/**
 * Blocked egress approval surfaced when `AgentNetworkPolicy.blocked_request_inbox`
 * holds a request for operator review.
 *
 * `request_id` is the durable identifier the runtime emitted with the
 * `BlockedEgress` event so a decision can be threaded back to the originating
 * request.
 */
export type ApprovalInboxBlockedEgress = {
    /**
     * Free-form additional context captured at block time (rule id, matched
     * hostname pattern, request size, etc.).
     */
    details?: unknown;
    host: string;
    method?: string | null;
    path?: string | null;
    port: number;
    reason?: string | null;
    request_id: string;
};

/**
 * Body for `POST /inbox/approvals/{entry_id}/decide`.
 */
export type ApprovalInboxDecisionRequest = {
    /**
     * Optional operator note recorded in the audit chain alongside the
     * decision.
     */
    comment?: string | null;
    decision: ApprovalInboxDecisionVerb;
};

/**
 * Response returned after recording a decision.
 */
export type ApprovalInboxDecisionResponse = {
    decision_state: ApprovalDecisionState;
    entry_id: string;
};

/**
 * Decision verb accepted by the inbox decision endpoint.
 *
 * Distinct from `CloudRunApprovalDecisionValue` (which uses `approve`/`reject`)
 * because the inbox is the operator surface and `deny` reads better than
 * `reject` for non-tool kinds like blocked egress. The mapping into the
 * existing tool-call resume path is internal.
 */
export type ApprovalInboxDecisionVerb = 'approve' | 'deny';

/**
 * One entry in the unified approval inbox.
 *
 * `entry_id` is inbox-scoped and stable for the lifetime of the entry; callers
 * pass it back to the decision endpoint. Tool-call entries encode
 * `(run_id, tool_call_id)` so the inbox does not need a separate persistence
 * row. Blocked-egress entries use a real UUID backed by storage.
 */
export type ApprovalInboxEntry = (ApprovalInboxToolCall & {
    created_at: string;
    decision_state: ApprovalDecisionState;
    deployment_id: string;
    entry_id: string;
    expires_at?: string | null;
    run_id: string;
} & {
    kind: 'tool_call';
}) | (ApprovalInboxBlockedEgress & {
    created_at: string;
    decision_state: ApprovalDecisionState;
    deployment_id: string;
    entry_id: string;
    expires_at?: string | null;
    /**
     * Egress can fire outside of a run (background reconciliation,
     * scheduled jobs that haven't claimed a run row yet).
     */
    run_id?: string | null;
} & {
    kind: 'blocked_egress';
}) | (ApprovalInboxOther & {
    created_at: string;
    decision_state: ApprovalDecisionState;
    deployment_id: string;
    entry_id: string;
    expires_at?: string | null;
    run_id?: string | null;
} & {
    kind: 'other';
});

/**
 * Listing response for the approval inbox.
 */
export type ApprovalInboxListResponse = {
    entries: Array<ApprovalInboxEntry>;
    /**
     * Opaque cursor for the next page; absent when no further entries exist.
     */
    next_cursor?: string | null;
};

/**
 * Catch-all variant so future approval kinds can land in the inbox without a
 * model rev. Callers that do not yet know the subkind should still be able
 * to render the row.
 *
 * `subkind` (rather than `kind`) avoids clashing with the enum-level
 * `kind` discriminator tag.
 */
export type ApprovalInboxOther = {
    payload?: unknown;
    reason?: string | null;
    subkind: string;
};

/**
 * Tool-call approval surfaced from an `awaiting_approval` run.
 *
 * `tool_call_id` is the orchestrator-supplied id that round-trips into the
 * `approval_decisions` array on resume. `tool_ref` is the human-meaningful
 * tool name (e.g. `seren_publisher_request`).
 */
export type ApprovalInboxToolCall = {
    function_call_id?: string | null;
    reason?: string | null;
    /**
     * Arguments preview. Callers may truncate large payloads upstream; this
     * field is opaque JSON so the renderer decides how to display it.
     */
    request_payload_summary?: unknown;
    tool_call_id: string;
    tool_ref: string;
};

/**
 * A single audit trail entry.
 */
export type AuditEntry = {
    action: string;
    actor: string;
    created_at: string;
    details: unknown;
    entry_hash: string;
    id: string;
    invocation_id?: string | null;
    organization_id: string;
    prev_hash: string;
    publisher_id?: string | null;
    sequence_number: number;
};

/**
 * 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;
};

/**
 * Deployment bundle metadata without raw bundle content.
 */
export type CloudDeploymentBundle = {
    created_at: string;
    id: string;
    organization_id: string;
    sha256: string;
    size_bytes: number;
    source_kind: CloudDeploymentBundleSourceKind;
    updated_at: string;
    uploaded_at?: string | null;
    user_id: string;
};

/**
 * Deployment bundle metadata plus current deployment references.
 */
export type CloudDeploymentBundleDetail = {
    bundle: CloudDeploymentBundle;
    deployment_ids: Array<string>;
};

/**
 * Short-lived download instructions for a deployment's runtime bundle.
 */
export type CloudDeploymentBundleDownloadResponse = {
    deployment_bundle_id: string;
    deployment_id: string;
    download_expires_at: string;
    download_headers?: {
        [key: string]: string;
    };
    download_url: string;
    sha256: string;
    size_bytes: number;
    source_kind: CloudDeploymentBundleSourceKind;
};

/**
 * Deployment bundle artifact format.
 *
 * This is intentionally a closed server-supported set. Add formats by
 * migration when Seren Cloud can validate and execute them.
 */
export type CloudDeploymentBundleSourceKind = 'tar_gz';

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

/**
 * Reusable execution environment profile for cloud deployments.
 */
export type CloudDeploymentEnvironment = {
    created_at: string;
    description?: string | null;
    docker_image: string;
    id: string;
    is_default: boolean;
    name: string;
    organization_id: string;
    setup_commands: unknown;
    updated_at: string;
    user_id: string;
};

/**
 * Snapshot of the current eval-set verdict alongside the baseline captured at
 * the last successful apply. Reports the delta on `passed` so operators can
 * see regressions explicitly. `current_passed`/`current_failed` are `None`
 * when no eval run has completed against the gated set yet; in that case the
 * status carries an explanatory `reason`.
 */
export type CloudDeploymentEvalDrift = {
    baseline?: null | EvalGateDriftBaseline;
    checked_at: string;
    current_completed_at?: string | null;
    current_failed?: number | null;
    current_passed?: number | null;
    current_run_id?: string | null;
    current_run_status?: string | null;
    current_verdict_status?: string | null;
    deployment_id: string;
    eval_gate_set_id: string;
    /**
     * `current_failed - baseline_failed` when both sides are present.
     */
    failed_delta?: number | null;
    /**
     * Operator-safe one-line summary of the drift state. Always present.
     */
    message: string;
    /**
     * `current_passed - baseline_passed` when both sides are present.
     */
    passed_delta?: number | null;
};

/**
 * 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;
};

/**
 * Artifact emitted by a cloud run (for example PR links, plans, screenshots).
 */
export type CloudDeploymentRunArtifact = {
    artifact_type: string;
    created_at: string;
    deployment_id: string;
    id: string;
    organization_id: string;
    payload: unknown;
    run_event_id: string;
    title?: string | null;
    updated_at: string;
    url?: string | null;
    user_id: string;
};

/**
 * A single execution run event for a cloud deployment.
 */
export type CloudDeploymentRunEvent = {
    billed_duration_ms: number;
    completed_at?: string | null;
    compute_backend: CloudDeploymentComputeBackend;
    compute_cost_atomic: number;
    compute_cost_usd: string;
    conversation_id?: string | null;
    created_at: string;
    deployment_id: string;
    execution_id: string;
    execution_time_ms: number;
    id: string;
    inference_cost_atomic: number;
    inference_cost_usd: string;
    inference_input_tokens: number;
    inference_output_tokens: number;
    /**
     * Canonical JSON payload submitted to trigger the run.
     */
    invocation_payload: unknown;
    metadata: unknown;
    organization_id: string;
    /**
     * Raw stdout/stderr output. Universal fallback for all backend types.
     */
    output?: string | null;
    /**
     * Structured event trace for agentic executions (thinking, tool calls, text).
     * Null for non-agentic scripts that produce plain stdout/stderr.
     */
    output_events?: unknown;
    requested_cpu_millicores: number;
    requested_memory_mib: number;
    run_name?: string | null;
    session_id?: string | null;
    session_url?: string | null;
    source: string;
    started_at: string;
    status: string;
    status_message?: string | null;
    stop_reason?: string | null;
    updated_at: string;
    user_id: string;
};

/**
 * Response envelope for triggering a cloud deployment run.
 *
 * This schema intentionally covers both synchronous and asynchronous responses
 * across compute backends (`always_on`, `cron`, Cloudflare, Daytona).
 */
export type CloudDeploymentRunInvocationResponse = {
    /**
     * Atomic compute cost units when emitted by the backend.
     */
    compute_cost_atomic?: number | null;
    /**
     * Backend execution ID for correlating orchestrator/job-level status.
     */
    execution_id?: string | null;
    /**
     * Execution duration in milliseconds when available.
     */
    execution_time_ms?: number | null;
    /**
     * Process exit code for runtimes that expose it (for example Daytona).
     */
    exit_code?: number | null;
    /**
     * K8s Job name for queued cron executions.
     */
    job_name?: string | null;
    /**
     * Backend-specific result payload.
     */
    result?: unknown;
    /**
     * Persisted run event ID when the invocation is tracked in the run history table.
     */
    run_id?: string | null;
    /**
     * Daytona sandbox ID when applicable.
     */
    sandbox_id?: string | null;
    /**
     * Cloudflare Worker script name when applicable.
     */
    script_name?: string | null;
    /**
     * Lifecycle status reported by the backend (`queued`, `running`, `completed`, etc.).
     */
    status: string;
};

/**
 * Request body for triggering a cloud deployment run.
 *
 * Additional JSON fields are allowed and forwarded to the runtime.
 */
export type CloudDeploymentRunRequest = {
    /**
     * Optional approval decisions used when resuming a paused run checkpoint.
     */
    approval_decisions?: Array<CloudRunApprovalDecision> | null;
    /**
     * Whether to request async execution for always-on orchestrators.
     */
    async?: boolean | null;
    /**
     * Optional message for orchestrated runtimes.
     */
    message?: string | null;
    /**
     * Optional checkpoint identifier used to resume an awaiting-approval run.
     */
    resume_checkpoint_id?: string | null;
    /**
     * Optional client-provided run identifier (used by some orchestrators).
     */
    run_id?: string | null;
};

/**
 * 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;
};

/**
 * Reusable eval baseline captured from a run or created manually later.
 */
export type CloudEvalCase = {
    created_at: string;
    created_by_user_id: string;
    deployment_id?: string | null;
    eval_set_id: string;
    expected_eval_capture: unknown;
    expected_output?: string | null;
    expected_output_sha256?: string | null;
    expected_replay_events: unknown;
    id: string;
    invocation_payload: unknown;
    metadata: unknown;
    name: string;
    organization_id: string;
    source_kind: string;
    source_run_id?: string | null;
    updated_at: string;
};

/**
 * Per-case result row captured when running an eval set.
 */
export type CloudEvalCaseResult = {
    actual_eval_capture: unknown;
    actual_output_sha256?: string | null;
    actual_replay_events: unknown;
    actual_run_id?: string | null;
    actual_status?: string | null;
    comparison: unknown;
    completed_at?: string | null;
    created_at: string;
    deployment_id?: string | null;
    eval_case_id: string;
    eval_run_id: string;
    eval_set_id: string;
    expected_eval_capture: unknown;
    expected_output_sha256?: string | null;
    expected_replay_events: unknown;
    expected_status?: string | null;
    id: string;
    metadata: unknown;
    organization_id: string;
    started_at?: string | null;
    status: string;
    status_message?: string | null;
    updated_at: string;
};

/**
 * Durable pass/fail criteria for a seren-cloud eval set.
 */
export type CloudEvalCriteria = {
    max_errored_cases?: number;
    max_failed_cases?: number;
    max_missing_actual_eval_capture_cases?: number;
    max_missing_actual_replay_cases?: number;
    max_output_mismatches?: number;
    max_status_mismatches?: number;
    max_trajectory_mismatches?: number;
    min_completion_rate?: number;
    min_field_match_rate?: number;
    min_score?: number;
};

/**
 * Durable execution record for running an eval set against a deployment.
 */
export type CloudEvalRun = {
    completed_at?: string | null;
    completed_cases: number;
    created_at: string;
    created_by_user_id: string;
    deployment_id?: string | null;
    errored_cases: number;
    eval_set_id: string;
    failed_cases: number;
    id: string;
    metadata: unknown;
    organization_id: string;
    passed_cases: number;
    started_at?: string | null;
    status: string;
    status_message?: string | null;
    summary: CloudEvalRunSummary;
    total_cases: number;
    updated_at: string;
    verdict: CloudEvalRunVerdict;
};

/**
 * Representative failures attached to an eval run summary.
 */
export type CloudEvalRunFailureExample = {
    actual_run_id?: string | null;
    case_name?: string | null;
    eval_case_id: string;
    notes?: Array<string>;
    status: string;
};

/**
 * Roll-up summary for an eval run.
 */
export type CloudEvalRunSummary = {
    compared_cases: number;
    completion_rate: number;
    failure_examples?: Array<CloudEvalRunFailureExample>;
    field_comparisons: number;
    field_match_rate: number;
    field_mismatches: number;
    first_errored_case_id?: string | null;
    first_failed_case_id?: string | null;
    missing_actual_eval_capture_cases: number;
    missing_actual_replay_cases: number;
    output_checked_cases: number;
    output_mismatches: number;
    pass_rate: number;
    score: number;
    status_checked_cases: number;
    status_mismatches: number;
    trajectory_checked_cases: number;
    trajectory_mismatches: number;
};

/**
 * Durable pass/fail verdict derived from an eval run and its criteria.
 */
export type CloudEvalRunVerdict = {
    criteria: CloudEvalCriteria;
    evaluated_at?: string | null;
    failing_checks?: Array<CloudEvalRunVerdictCheck>;
    status: string;
};

/**
 * Individual threshold failure that contributed to an eval verdict.
 */
export type CloudEvalRunVerdictCheck = {
    actual: unknown;
    key: string;
    label: string;
    message: string;
    operator: string;
    target: unknown;
};

/**
 * Durable grouping for reusable seren-cloud eval cases.
 */
export type CloudEvalSet = {
    created_at: string;
    created_by_user_id: string;
    criteria: CloudEvalCriteria;
    deployment_id?: string | null;
    description?: string | null;
    id: string;
    metadata: unknown;
    name: string;
    organization_id: string;
    schedule?: null | CloudEvalSetSchedule;
    updated_at: string;
};

/**
 * Scheduler state for automatically executing a seren-cloud eval set.
 */
export type CloudEvalSetSchedule = {
    schedule_cron: string;
    schedule_last_attempted_at?: string | null;
    schedule_last_eval_run_id?: string | null;
    schedule_last_message?: string | null;
    schedule_last_status?: string | null;
    schedule_next_run_at: string;
    schedule_timezone: string;
};

/**
 * Request body for enabling or updating scheduled eval execution.
 */
export type CloudEvalSetScheduleRequest = {
    schedule_cron: string;
    schedule_timezone: string;
};

/**
 * Awaiting-approval run entry returned by the approval inbox endpoints.
 */
export type CloudPendingApprovalRun = {
    compute_backend: CloudDeploymentComputeBackend;
    deployment_id: string;
    execution_id: string;
    pending_approvals?: Array<CloudRunPendingApproval>;
    run_id: string;
    run_name?: string | null;
    source: string;
    started_at: string;
    status: string;
    status_message?: string | null;
    updated_at: string;
};

/**
 * Approval decision submitted when resuming an awaiting-approval run.
 */
export type CloudRunApprovalDecision = {
    decision: CloudRunApprovalDecisionValue;
    id: string;
};

/**
 * Decision recorded by an approval event.
 */
export type CloudRunApprovalDecisionKind = 'approve' | 'reject' | 'escalate';

/**
 * Normalized approval action accepted by the cloud resume API.
 */
export type CloudRunApprovalDecisionValue = 'approve' | 'reject';

/**
 * Terminal status reported by a `Done` event.
 */
export type CloudRunDoneStatus = 'ok' | 'error' | 'cancelled';

/**
 * Typed cause of a terminal `error` event. Operator-safe descriptors only;
 * the offending content must not appear in the cause label.
 */
export type CloudRunErrorCause = 'agent' | 'model' | 'tool' | 'session' | 'artifact' | 'memory' | 'config' | 'io' | 'serialization' | 'timeout' | 'task' | 'guardrail' | 'approval' | 'unknown';

/**
 * Eval records linked to a run, either as the promoted source or as an actual replay target.
 */
export type CloudRunEvalsResponse = {
    actual_eval_case_results?: Array<CloudEvalCaseResult>;
    run_id: string;
    source_eval_cases?: Array<CloudEvalCase>;
};

/**
 * How the run responded to a failing guardrail.
 */
export type CloudRunGuardrailAction = 'retry' | 'block' | 'fix' | 'human';

/**
 * The target of a guardrail validator.
 */
export type CloudRunGuardrailTarget = 'input' | 'output' | 'tool_input' | 'tool_output';

/**
 * A single event in the structured output trace.
 *
 * Matches the seren-desktop `WorkerEvent` model for consistency.
 * Stored as a JSON array in `output_events`.
 */
export type CloudRunOutputEvent = {
    text: string;
    type: 'text';
} | {
    duration_ms?: number | null;
    text: string;
    type: 'thinking';
} | {
    arguments?: string | null;
    id: string;
    name: string;
    status?: string | null;
    type: 'tool_call';
} | {
    content: string;
    id: string;
    is_error: boolean;
    type: 'tool_result';
} | {
    action?: string | null;
    id: string;
    input_bytes?: number | null;
    latency_ms?: number | null;
    lease_ref?: string | null;
    output_bytes?: number | null;
    reason: string;
    status?: null | CloudRunToolAuditStatus;
    tool: string;
    tool_ref_kind?: null | CloudRunToolRefKind;
    type: 'tool_audit';
} | {
    checkpoint_id?: string | null;
    details?: unknown;
    state: string;
    type: 'workflow';
} | {
    checkpoint_id?: string | null;
    reason?: string | null;
    tool_call_id?: string | null;
    type: 'approval_wait';
} | {
    actor?: string | null;
    checkpoint_id?: string | null;
    decision: CloudRunApprovalDecisionKind;
    reason?: string | null;
    tool_call_id?: string | null;
    type: 'approval_decision';
} | {
    name: string;
    target: CloudRunGuardrailTarget;
    type: 'guardrail_pass';
} | {
    action: CloudRunGuardrailAction;
    attempt?: number | null;
    message: string;
    name: string;
    target: CloudRunGuardrailTarget;
    type: 'guardrail_fail';
} | {
    from_agent?: string | null;
    reason?: string | null;
    to_agent: string;
    type: 'handoff';
} | {
    id: string;
    kind: string;
    sha256?: string | null;
    size_bytes?: number | null;
    type: 'artifact';
    uri?: string | null;
} | {
    reason?: string | null;
    status: CloudRunDoneStatus;
    type: 'done';
} | {
    summarizer_model_ref?: string | null;
    token_threshold?: number | null;
    tokens_before?: number | null;
    type: 'compaction_started';
} | {
    retained_event_count?: number | null;
    summarizer_model_ref?: string | null;
    tokens_after?: number | null;
    tokens_before?: number | null;
    type: 'compaction_finished';
} | {
    cause?: null | CloudRunErrorCause;
    message: string;
    type: 'error';
};

/**
 * Envelope carrying structured output event metadata.
 */
export type CloudRunOutputEventEnvelope = CloudRunOutputEvent & {
    content_index?: number | null;
    event_type?: string | null;
    item_id?: string | null;
    kind?: null | CloudRunOutputEventKind;
    output_index?: number | null;
    sequence_number?: number | null;
};

/**
 * Canonical taxonomy for structured run output events.
 */
export type CloudRunOutputEventKind = 'text' | 'thinking' | 'tool_call_started' | 'tool_call_completed' | 'tool_audit' | 'workflow' | 'approval_wait' | 'approval_decision' | 'guardrail_pass' | 'guardrail_fail' | 'handoff' | 'artifact' | 'compaction_started' | 'compaction_finished' | 'done' | 'error' | 'unknown';

/**
 * Pending approval attached to an `awaiting_approval` run.
 */
export type CloudRunPendingApproval = {
    args?: unknown;
    function_call_id?: string | null;
    id: string;
    reason?: string | null;
    tool: string;
};

/**
 * Current approval state for a run.
 */
export type CloudRunPendingApprovalsResponse = {
    checkpoint_id?: string | null;
    pending_approvals?: Array<CloudRunPendingApproval>;
    run_id: string;
    status: string;
};

/**
 * Comparison summary between two run replay captures.
 */
export type CloudRunReplayComparison = {
    baseline_deployment_id: string;
    baseline_eval_capture_present: boolean;
    baseline_replay_artifact_present: boolean;
    baseline_run_id: string;
    baseline_status: string;
    candidate_deployment_id: string;
    candidate_eval_capture_present: boolean;
    candidate_replay_artifact_present: boolean;
    candidate_run_id: string;
    candidate_status: string;
    field_matches: Array<CloudRunReplayFieldComparison>;
    first_event_mismatch?: null | CloudRunReplayEventMismatch;
    notes?: Array<string>;
    overall_match: boolean;
};

/**
 * The first structured replay event that differs between two runs.
 */
export type CloudRunReplayEventMismatch = {
    baseline: unknown;
    baseline_kind?: string | null;
    candidate: unknown;
    candidate_kind?: string | null;
    index: number;
};

/**
 * Field-level replay/eval summary comparison between two runs.
 */
export type CloudRunReplayFieldComparison = {
    baseline: unknown;
    candidate: unknown;
    field: string;
    label: string;
    matches: boolean;
};

/**
 * Response payload for explicitly closing an active run stream session.
 */
export type CloudRunStreamCloseResponse = {
    run_id: string;
    session_id: string;
    status: string;
};

/**
 * Success/failure status reported by a `tool_audit` event.
 */
export type CloudRunToolAuditStatus = 'success' | 'failure';

/**
 * Kind of underlying tool_ref a `tool_audit` event applies to. Mirrors the
 * `AgentToolRef` variants so operators can distinguish publisher calls from
 * MCP, connector, remote-agent, remote-HTTP, or preset-group invocations.
 */
export type CloudRunToolRefKind = 'publisher' | 'mcp' | 'connector' | 'remote_agent' | 'remote_http' | 'preset_group' | 'builtin' | 'unknown';

/**
 * Request body for registering a content-addressed deployment bundle.
 */
export type CreateCloudDeploymentBundleRequest = {
    /**
     * Lowercase hex SHA-256 digest of the raw bundle bytes.
     */
    sha256: string;
    /**
     * Exact raw bundle size in bytes.
     */
    size_bytes: number;
    /**
     * Bundle artifact format.
     */
    source_kind: CloudDeploymentBundleSourceKind;
};

/**
 * Response returned when a deployment bundle is registered.
 */
export type CreateCloudDeploymentBundleResponse = {
    deployment_bundle_id: string;
    sha256: string;
    size_bytes: number;
    source_kind: CloudDeploymentBundleSourceKind;
    upload_expires_at?: string | null;
    upload_headers?: {
        [key: string]: string;
    };
    upload_required: boolean;
    upload_url?: string | null;
};

/**
 * Request body for creating a reusable execution environment.
 */
export type CreateCloudDeploymentEnvironmentRequest = {
    description?: string | null;
    docker_image: string;
    is_default?: boolean | null;
    name: string;
    setup_commands?: Array<string> | null;
};

/**
 * Request body for creating a cloud deployment.
 *
 * The deployment envelope (name, skill, mode, schedule, eval gate, dashboard,
 * alert policy, visibility, environment) is on the request itself; all
 * runtime concerns (execution strategy, compute backend, limits, secrets,
 * config, requirements, etc.) live inside the embedded `WorkloadSpec`.
 */
export type CreateCloudDeploymentRequest = {
    alert_policy?: null | CloudDeploymentAlertPolicy;
    /**
     * Cron expression, required when `mode` is `cron`.
     */
    cron_schedule?: string | null;
    /**
     * Timezone for cron schedules. Defaults to `UTC` when omitted.
     */
    cron_timezone?: string | null;
    /**
     * UI rendering hints for custom dashboards.
     */
    dashboard_config?: unknown;
    /**
     * Optional reusable execution environment.
     */
    environment_id?: string | null;
    eval_gate?: null | EvalGate;
    /**
     * Deployment mode (always_on, cron, job).
     */
    mode: CloudDeploymentMode;
    /**
     * Human-readable deployment name. Auto-generated when omitted.
     */
    name?: string | null;
    /**
     * Stable slug identifying the skill being deployed.
     */
    skill_slug: string;
    /**
     * Visibility mode (`open` or `opaque`).
     */
    visibility?: string | null;
    /**
     * Runtime workload specification (execution strategy, compute, limits, ...).
     */
    workload: WorkloadSpec;
};

/**
 * Request body for executing an eval set against a deployment.
 */
export type CreateCloudEvalRunRequest = {
    deployment_id?: string | null;
    metadata?: unknown;
};

/**
 * Request body for creating a seren-cloud eval set.
 */
export type CreateCloudEvalSetRequest = {
    criteria?: CloudEvalCriteria;
    deployment_id?: string | null;
    description?: string | null;
    metadata?: unknown;
    name: string;
    schedule?: null | CloudEvalSetScheduleRequest;
};

/**
 * 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 DataResponseApprovalInboxDecisionResponse = {
    /**
     * Response returned after recording a decision.
     */
    data: {
        decision_state: ApprovalDecisionState;
        entry_id: 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 DataResponseApprovalInboxListResponse = {
    /**
     * Listing response for the approval inbox.
     */
    data: {
        entries: Array<ApprovalInboxEntry>;
        /**
         * Opaque cursor for the next page; absent when no further entries exist.
         */
        next_cursor?: string | null;
    };
    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 DataResponseAuditEntry = {
    /**
     * A single audit trail entry.
     */
    data: {
        action: string;
        actor: string;
        created_at: string;
        details: unknown;
        entry_hash: string;
        id: string;
        invocation_id?: string | null;
        organization_id: string;
        prev_hash: string;
        publisher_id?: string | null;
        sequence_number: number;
    };
    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 DataResponseCloudDeploymentBundle = {
    /**
     * Deployment bundle metadata without raw bundle content.
     */
    data: {
        created_at: string;
        id: string;
        organization_id: string;
        sha256: string;
        size_bytes: number;
        source_kind: CloudDeploymentBundleSourceKind;
        updated_at: string;
        uploaded_at?: string | null;
        user_id: 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 DataResponseCloudDeploymentBundleDetail = {
    /**
     * Deployment bundle metadata plus current deployment references.
     */
    data: {
        bundle: CloudDeploymentBundle;
        deployment_ids: Array<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 DataResponseCloudDeploymentBundleDownloadResponse = {
    /**
     * Short-lived download instructions for a deployment's runtime bundle.
     */
    data: {
        deployment_bundle_id: string;
        deployment_id: string;
        download_expires_at: string;
        download_headers?: {
            [key: string]: string;
        };
        download_url: string;
        sha256: string;
        size_bytes: number;
        source_kind: CloudDeploymentBundleSourceKind;
    };
    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 DataResponseCloudDeploymentEnvironment = {
    /**
     * Reusable execution environment profile for cloud deployments.
     */
    data: {
        created_at: string;
        description?: string | null;
        docker_image: string;
        id: string;
        is_default: boolean;
        name: string;
        organization_id: string;
        setup_commands: unknown;
        updated_at: string;
        user_id: 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 DataResponseCloudDeploymentEvalDrift = {
    /**
     * Snapshot of the current eval-set verdict alongside the baseline captured at
     * the last successful apply. Reports the delta on `passed` so operators can
     * see regressions explicitly. `current_passed`/`current_failed` are `None`
     * when no eval run has completed against the gated set yet; in that case the
     * status carries an explanatory `reason`.
     */
    data: {
        baseline?: null | EvalGateDriftBaseline;
        checked_at: string;
        current_completed_at?: string | null;
        current_failed?: number | null;
        current_passed?: number | null;
        current_run_id?: string | null;
        current_run_status?: string | null;
        current_verdict_status?: string | null;
        deployment_id: string;
        eval_gate_set_id: string;
        /**
         * `current_failed - baseline_failed` when both sides are present.
         */
        failed_delta?: number | null;
        /**
         * Operator-safe one-line summary of the drift state. Always present.
         */
        message: string;
        /**
         * `current_passed - baseline_passed` when both sides are present.
         */
        passed_delta?: number | null;
    };
    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 DataResponseCloudDeploymentRunEvent = {
    /**
     * A single execution run event for a cloud deployment.
     */
    data: {
        billed_duration_ms: number;
        completed_at?: string | null;
        compute_backend: CloudDeploymentComputeBackend;
        compute_cost_atomic: number;
        compute_cost_usd: string;
        conversation_id?: string | null;
        created_at: string;
        deployment_id: string;
        execution_id: string;
        execution_time_ms: number;
        id: string;
        inference_cost_atomic: number;
        inference_cost_usd: string;
        inference_input_tokens: number;
        inference_output_tokens: number;
        /**
         * Canonical JSON payload submitted to trigger the run.
         */
        invocation_payload: unknown;
        metadata: unknown;
        organization_id: string;
        /**
         * Raw stdout/stderr output. Universal fallback for all backend types.
         */
        output?: string | null;
        /**
         * Structured event trace for agentic executions (thinking, tool calls, text).
         * Null for non-agentic scripts that produce plain stdout/stderr.
         */
        output_events?: unknown;
        requested_cpu_millicores: number;
        requested_memory_mib: number;
        run_name?: string | null;
        session_id?: string | null;
        session_url?: string | null;
        source: string;
        started_at: string;
        status: string;
        status_message?: string | null;
        stop_reason?: string | null;
        updated_at: string;
        user_id: 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 DataResponseCloudDeploymentRunInvocationResponse = {
    /**
     * Response envelope for triggering a cloud deployment run.
     *
     * This schema intentionally covers both synchronous and asynchronous responses
     * across compute backends (`always_on`, `cron`, Cloudflare, Daytona).
     */
    data: {
        /**
         * Atomic compute cost units when emitted by the backend.
         */
        compute_cost_atomic?: number | null;
        /**
         * Backend execution ID for correlating orchestrator/job-level status.
         */
        execution_id?: string | null;
        /**
         * Execution duration in milliseconds when available.
         */
        execution_time_ms?: number | null;
        /**
         * Process exit code for runtimes that expose it (for example Daytona).
         */
        exit_code?: number | null;
        /**
         * K8s Job name for queued cron executions.
         */
        job_name?: string | null;
        /**
         * Backend-specific result payload.
         */
        result?: unknown;
        /**
         * Persisted run event ID when the invocation is tracked in the run history table.
         */
        run_id?: string | null;
        /**
         * Daytona sandbox ID when applicable.
         */
        sandbox_id?: string | null;
        /**
         * Cloudflare Worker script name when applicable.
         */
        script_name?: string | null;
        /**
         * Lifecycle status reported by the backend (`queued`, `running`, `completed`, etc.).
         */
        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 DataResponseCloudEvalCase = {
    /**
     * Reusable eval baseline captured from a run or created manually later.
     */
    data: {
        created_at: string;
        created_by_user_id: string;
        deployment_id?: string | null;
        eval_set_id: string;
        expected_eval_capture: unknown;
        expected_output?: string | null;
        expected_output_sha256?: string | null;
        expected_replay_events: unknown;
        id: string;
        invocation_payload: unknown;
        metadata: unknown;
        name: string;
        organization_id: string;
        source_kind: string;
        source_run_id?: string | null;
        updated_at: 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 DataResponseCloudEvalCaseResult = {
    /**
     * Per-case result row captured when running an eval set.
     */
    data: {
        actual_eval_capture: unknown;
        actual_output_sha256?: string | null;
        actual_replay_events: unknown;
        actual_run_id?: string | null;
        actual_status?: string | null;
        comparison: unknown;
        completed_at?: string | null;
        created_at: string;
        deployment_id?: string | null;
        eval_case_id: string;
        eval_run_id: string;
        eval_set_id: string;
        expected_eval_capture: unknown;
        expected_output_sha256?: string | null;
        expected_replay_events: unknown;
        expected_status?: string | null;
        id: string;
        metadata: unknown;
        organization_id: string;
        started_at?: string | null;
        status: string;
        status_message?: string | null;
        updated_at: 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 DataResponseCloudEvalRun = {
    /**
     * Durable execution record for running an eval set against a deployment.
     */
    data: {
        completed_at?: string | null;
        completed_cases: number;
        created_at: string;
        created_by_user_id: string;
        deployment_id?: string | null;
        errored_cases: number;
        eval_set_id: string;
        failed_cases: number;
        id: string;
        metadata: unknown;
        organization_id: string;
        passed_cases: number;
        started_at?: string | null;
        status: string;
        status_message?: string | null;
        summary: CloudEvalRunSummary;
        total_cases: number;
        updated_at: string;
        verdict: CloudEvalRunVerdict;
    };
    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 DataResponseCloudEvalSet = {
    /**
     * Durable grouping for reusable seren-cloud eval cases.
     */
    data: {
        created_at: string;
        created_by_user_id: string;
        criteria: CloudEvalCriteria;
        deployment_id?: string | null;
        description?: string | null;
        id: string;
        metadata: unknown;
        name: string;
        organization_id: string;
        schedule?: null | CloudEvalSetSchedule;
        updated_at: 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 DataResponseCloudRunEvalsResponse = {
    /**
     * Eval records linked to a run, either as the promoted source or as an actual replay target.
     */
    data: {
        actual_eval_case_results?: Array<CloudEvalCaseResult>;
        run_id: string;
        source_eval_cases?: Array<CloudEvalCase>;
    };
    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 DataResponseCloudRunPendingApprovalsResponse = {
    /**
     * Current approval state for a run.
     */
    data: {
        checkpoint_id?: string | null;
        pending_approvals?: Array<CloudRunPendingApproval>;
        run_id: string;
        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 DataResponseCloudRunReplayComparison = {
    /**
     * Comparison summary between two run replay captures.
     */
    data: {
        baseline_deployment_id: string;
        baseline_eval_capture_present: boolean;
        baseline_replay_artifact_present: boolean;
        baseline_run_id: string;
        baseline_status: string;
        candidate_deployment_id: string;
        candidate_eval_capture_present: boolean;
        candidate_replay_artifact_present: boolean;
        candidate_run_id: string;
        candidate_status: string;
        field_matches: Array<CloudRunReplayFieldComparison>;
        first_event_mismatch?: null | CloudRunReplayEventMismatch;
        notes?: Array<string>;
        overall_match: 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 DataResponseCloudRunStreamCloseResponse = {
    /**
     * Response payload for explicitly closing an active run stream session.
     */
    data: {
        run_id: string;
        session_id: string;
        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 DataResponseCreateCloudDeploymentBundleResponse = {
    /**
     * Response returned when a deployment bundle is registered.
     */
    data: {
        deployment_bundle_id: string;
        sha256: string;
        size_bytes: number;
        source_kind: CloudDeploymentBundleSourceKind;
        upload_expires_at?: string | null;
        upload_headers?: {
            [key: string]: string;
        };
        upload_required: boolean;
        upload_url?: string | null;
    };
    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 DataResponseDeploymentSpendSummary = {
    /**
     * Aggregated spend summary for a single cloud deployment.
     */
    data: {
        compute_cost_usd: string;
        first_event_at?: string | null;
        inference_cost_usd: string;
        last_event_at?: string | null;
        run_count: number;
        total_cost_usd: 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 DataResponseVecAuditEntry = {
    data: Array<{
        action: string;
        actor: string;
        created_at: string;
        details: unknown;
        entry_hash: string;
        id: string;
        invocation_id?: string | null;
        organization_id: string;
        prev_hash: string;
        publisher_id?: string | null;
        sequence_number: number;
    }>;
    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 DataResponseVecCloudDeploymentEnvironment = {
    data: Array<{
        created_at: string;
        description?: string | null;
        docker_image: string;
        id: string;
        is_default: boolean;
        name: string;
        organization_id: string;
        setup_commands: unknown;
        updated_at: string;
        user_id: 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 DataResponseVecCloudDeploymentRunArtifact = {
    data: Array<{
        artifact_type: string;
        created_at: string;
        deployment_id: string;
        id: string;
        organization_id: string;
        payload: unknown;
        run_event_id: string;
        title?: string | null;
        updated_at: string;
        url?: string | null;
        user_id: 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 DataResponseVecCloudDeploymentRunEvent = {
    data: Array<{
        billed_duration_ms: number;
        completed_at?: string | null;
        compute_backend: CloudDeploymentComputeBackend;
        compute_cost_atomic: number;
        compute_cost_usd: string;
        conversation_id?: string | null;
        created_at: string;
        deployment_id: string;
        execution_id: string;
        execution_time_ms: number;
        id: string;
        inference_cost_atomic: number;
        inference_cost_usd: string;
        inference_input_tokens: number;
        inference_output_tokens: number;
        /**
         * Canonical JSON payload submitted to trigger the run.
         */
        invocation_payload: unknown;
        metadata: unknown;
        organization_id: string;
        /**
         * Raw stdout/stderr output. Universal fallback for all backend types.
         */
        output?: string | null;
        /**
         * Structured event trace for agentic executions (thinking, tool calls, text).
         * Null for non-agentic scripts that produce plain stdout/stderr.
         */
        output_events?: unknown;
        requested_cpu_millicores: number;
        requested_memory_mib: number;
        run_name?: string | null;
        session_id?: string | null;
        session_url?: string | null;
        source: string;
        started_at: string;
        status: string;
        status_message?: string | null;
        stop_reason?: string | null;
        updated_at: string;
        user_id: 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 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 DataResponseVecCloudEvalCase = {
    data: Array<{
        created_at: string;
        created_by_user_id: string;
        deployment_id?: string | null;
        eval_set_id: string;
        expected_eval_capture: unknown;
        expected_output?: string | null;
        expected_output_sha256?: string | null;
        expected_replay_events: unknown;
        id: string;
        invocation_payload: unknown;
        metadata: unknown;
        name: string;
        organization_id: string;
        source_kind: string;
        source_run_id?: string | null;
        updated_at: 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 DataResponseVecCloudEvalCaseResult = {
    data: Array<{
        actual_eval_capture: unknown;
        actual_output_sha256?: string | null;
        actual_replay_events: unknown;
        actual_run_id?: string | null;
        actual_status?: string | null;
        comparison: unknown;
        completed_at?: string | null;
        created_at: string;
        deployment_id?: string | null;
        eval_case_id: string;
        eval_run_id: string;
        eval_set_id: string;
        expected_eval_capture: unknown;
        expected_output_sha256?: string | null;
        expected_replay_events: unknown;
        expected_status?: string | null;
        id: string;
        metadata: unknown;
        organization_id: string;
        started_at?: string | null;
        status: string;
        status_message?: string | null;
        updated_at: 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 DataResponseVecCloudEvalRun = {
    data: Array<{
        completed_at?: string | null;
        completed_cases: number;
        created_at: string;
        created_by_user_id: string;
        deployment_id?: string | null;
        errored_cases: number;
        eval_set_id: string;
        failed_cases: number;
        id: string;
        metadata: unknown;
        organization_id: string;
        passed_cases: number;
        started_at?: string | null;
        status: string;
        status_message?: string | null;
        summary: CloudEvalRunSummary;
        total_cases: number;
        updated_at: string;
        verdict: CloudEvalRunVerdict;
    }>;
    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 DataResponseVecCloudEvalSet = {
    data: Array<{
        created_at: string;
        created_by_user_id: string;
        criteria: CloudEvalCriteria;
        deployment_id?: string | null;
        description?: string | null;
        id: string;
        metadata: unknown;
        name: string;
        organization_id: string;
        schedule?: null | CloudEvalSetSchedule;
        updated_at: 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 DataResponseVecCloudPendingApprovalRun = {
    data: Array<{
        compute_backend: CloudDeploymentComputeBackend;
        deployment_id: string;
        execution_id: string;
        pending_approvals?: Array<CloudRunPendingApproval>;
        run_id: string;
        run_name?: string | null;
        source: string;
        started_at: string;
        status: string;
        status_message?: string | null;
        updated_at: 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 DataResponseVecCloudRunOutputEventEnvelope = {
    /**
     * Envelope carrying structured output event metadata.
     */
    data: Array<CloudRunOutputEvent & {
        content_index?: number | null;
        event_type?: string | null;
        item_id?: string | null;
        kind?: null | CloudRunOutputEventKind;
        output_index?: number | null;
        sequence_number?: number | null;
    }>;
    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 DataResponseVerificationResult = {
    /**
     * Result of verifying the audit chain integrity.
     */
    data: {
        entries_checked: number;
        error?: string | null;
        first_invalid_sequence?: number | null;
        verified: boolean;
    };
    pagination?: null | PaginationMeta;
};

/**
 * Aggregated spend summary for a single cloud deployment.
 */
export type DeploymentSpendSummary = {
    compute_cost_usd: string;
    first_event_at?: string | null;
    inference_cost_usd: string;
    last_event_at?: string | null;
    run_count: number;
    total_cost_usd: string;
};

/**
 * 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;
};

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

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

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

export type ManagedAgentRuntimeAdapter = 'adk';

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';

/**
 * 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;
};

/**
 * Request body for promoting a run into a reusable eval case.
 */
export type PromoteRunToCloudEvalCaseRequest = {
    metadata?: unknown;
    name?: string | null;
};

/**
 * 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;
};

/**
 * 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;
};

/**
 * 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;
};

/**
 * Request body for updating a reusable execution environment.
 */
export type UpdateCloudDeploymentEnvironmentRequest = {
    description?: string | null;
    docker_image?: string | null;
    is_default?: boolean | null;
    name?: string | null;
    setup_commands?: Array<string> | null;
};

/**
 * Partial update request for an existing cloud deployment.
 *
 * Mirrors the deployment envelope as `Option<...>` for partial update. Runtime
 * workload changes use deployment-specific replacement/update endpoints.
 */
export type UpdateCloudDeploymentRequest = {
    alert_policy?: null | CloudDeploymentAlertPolicy;
    /**
     * Clear any existing alert policy.
     */
    clear_alert_policy?: boolean;
    /**
     * Clear any existing dashboard config.
     */
    clear_dashboard_config?: boolean;
    /**
     * Clear any existing eval gate configuration.
     */
    clear_eval_gate?: boolean;
    /**
     * Updated dashboard rendering config.
     */
    dashboard_config?: unknown;
    eval_gate?: null | EvalGate;
    /**
     * Updated visibility mode.
     */
    visibility?: string | null;
};

/**
 * Request body for replacing a seren-cloud eval set.
 */
export type UpdateCloudEvalSetRequest = {
    criteria?: CloudEvalCriteria;
    deployment_id?: string | null;
    description?: string | null;
    metadata?: unknown;
    name: string;
    schedule?: null | CloudEvalSetScheduleRequest;
};

/**
 * Result of verifying the audit chain integrity.
 */
export type VerificationResult = {
    entries_checked: number;
    error?: string | null;
    first_invalid_sequence?: number | null;
    verified: boolean;
};

/**
 * 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 SerenCloudListAuditEntriesData = {
    body?: never;
    path?: never;
    query?: {
        /**
         * Max audit entries to return (default: 50, max: 200)
         */
        limit?: number;
        /**
         * Pagination offset
         */
        offset?: number;
        /**
         * Filter by exact audit action
         */
        action?: string;
        /**
         * Case-insensitive search across action, actor, and details
         */
        q?: string;
    };
    url: '/audit';
};

export type SerenCloudListAuditEntriesResponses = {
    /**
     * Audit entries listed
     */
    200: DataResponseVecAuditEntry;
};

export type SerenCloudListAuditEntriesResponse = SerenCloudListAuditEntriesResponses[keyof SerenCloudListAuditEntriesResponses];

export type SerenCloudVerifyAuditData = {
    body?: never;
    path?: never;
    query?: {
        /**
         * Max audit entries to verify in sequence order (default: 10000, max: 100000)
         */
        limit?: number;
    };
    url: '/audit/verify';
};

export type SerenCloudVerifyAuditResponses = {
    /**
     * Audit verification result
     */
    200: DataResponseVerificationResult;
};

export type SerenCloudVerifyAuditResponse = SerenCloudVerifyAuditResponses[keyof SerenCloudVerifyAuditResponses];

export type SerenCloudGetAuditEntryData = {
    body?: never;
    path: {
        /**
         * Audit entry ID
         */
        entry_id: string;
    };
    query?: never;
    url: '/audit/{entry_id}';
};

export type SerenCloudGetAuditEntryErrors = {
    /**
     * Audit entry not found
     */
    404: unknown;
};

export type SerenCloudGetAuditEntryResponses = {
    /**
     * Audit entry details
     */
    200: DataResponseAuditEntry;
};

export type SerenCloudGetAuditEntryResponse = SerenCloudGetAuditEntryResponses[keyof SerenCloudGetAuditEntryResponses];

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

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

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

export type SerenCloudDeployResponse = SerenCloudDeployResponses[keyof SerenCloudDeployResponses];

export type SerenCloudCreateDeploymentBundleData = {
    body: CreateCloudDeploymentBundleRequest;
    path?: never;
    query?: never;
    url: '/deployment-bundles';
};

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

export type SerenCloudCreateDeploymentBundleResponses = {
    /**
     * Deployment bundle registered
     */
    200: DataResponseCreateCloudDeploymentBundleResponse;
};

export type SerenCloudCreateDeploymentBundleResponse = SerenCloudCreateDeploymentBundleResponses[keyof SerenCloudCreateDeploymentBundleResponses];

export type SerenCloudGetDeploymentBundleData = {
    body?: never;
    path: {
        /**
         * Deployment bundle ID
         */
        id: string;
    };
    query?: never;
    url: '/deployment-bundles/{id}';
};

export type SerenCloudGetDeploymentBundleErrors = {
    /**
     * Unauthorized
     */
    401: unknown;
    /**
     * Deployment bundle not found
     */
    404: unknown;
};

export type SerenCloudGetDeploymentBundleResponses = {
    /**
     * Deployment bundle metadata
     */
    200: DataResponseCloudDeploymentBundleDetail;
};

export type SerenCloudGetDeploymentBundleResponse = SerenCloudGetDeploymentBundleResponses[keyof SerenCloudGetDeploymentBundleResponses];

export type SerenCloudCompleteDeploymentBundleUploadData = {
    body?: never;
    path: {
        /**
         * Deployment bundle ID
         */
        id: string;
    };
    query?: never;
    url: '/deployment-bundles/{id}/complete';
};

export type SerenCloudCompleteDeploymentBundleUploadErrors = {
    /**
     * Bad request
     */
    400: unknown;
    /**
     * Unauthorized
     */
    401: unknown;
    /**
     * Deployment bundle not found
     */
    404: unknown;
};

export type SerenCloudCompleteDeploymentBundleUploadResponses = {
    /**
     * Deployment bundle upload completed
     */
    200: DataResponseCloudDeploymentBundle;
};

export type SerenCloudCompleteDeploymentBundleUploadResponse = SerenCloudCompleteDeploymentBundleUploadResponses[keyof SerenCloudCompleteDeploymentBundleUploadResponses];

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

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

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

export type SerenCloudListDeploymentsResponse = SerenCloudListDeploymentsResponses[keyof SerenCloudListDeploymentsResponses];

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

export type SerenCloudDeleteErrors = {
    /**
     * Not found
     */
    404: unknown;
};

export type SerenCloudDeleteResponses = {
    /**
     * Deployment deleted
     */
    200: DataResponseCloudDeploymentActionStatusResponse;
};

export type SerenCloudDeleteResponse = SerenCloudDeleteResponses[keyof SerenCloudDeleteResponses];

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

export type SerenCloudGetDeploymentErrors = {
    /**
     * Not found
     */
    404: unknown;
};

export type SerenCloudGetDeploymentResponses = {
    /**
     * Deployment details
     */
    200: DataResponseCloudDeploymentSummary;
};

export type SerenCloudGetDeploymentResponse = SerenCloudGetDeploymentResponses[keyof SerenCloudGetDeploymentResponses];

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

export type SerenCloudUpdateConfigErrors = {
    /**
     * Not found
     */
    404: unknown;
};

export type SerenCloudUpdateConfigResponses = {
    /**
     * Config updated
     */
    200: DataResponseCloudDeploymentActionStatusResponse;
};

export type SerenCloudUpdateConfigResponse = SerenCloudUpdateConfigResponses[keyof SerenCloudUpdateConfigResponses];

export type SerenCloudDeploymentAuditData = {
    body?: never;
    path: {
        /**
         * Deployment ID
         */
        id: string;
    };
    query?: {
        /**
         * Max audit entries to return (default: 50, max: 200)
         */
        limit?: number;
        /**
         * Pagination offset
         */
        offset?: number;
        /**
         * Filter by exact audit action
         */
        action?: string;
        /**
         * Case-insensitive search across action, actor, and details
         */
        q?: string;
    };
    url: '/deployments/{id}/audit';
};

export type SerenCloudDeploymentAuditErrors = {
    /**
     * Deployment not found
     */
    404: unknown;
};

export type SerenCloudDeploymentAuditResponses = {
    /**
     * Deployment audit entries listed
     */
    200: DataResponseVecAuditEntry;
};

export type SerenCloudDeploymentAuditResponse = SerenCloudDeploymentAuditResponses[keyof SerenCloudDeploymentAuditResponses];

export type SerenCloudGetDeploymentBundleDownloadData = {
    body?: never;
    path: {
        /**
         * Deployment ID
         */
        id: string;
    };
    query?: never;
    url: '/deployments/{id}/deployment-bundle-download';
};

export type SerenCloudGetDeploymentBundleDownloadErrors = {
    /**
     * Bad request
     */
    400: unknown;
    /**
     * Unauthorized
     */
    401: unknown;
    /**
     * Forbidden
     */
    403: unknown;
    /**
     * Deployment or bundle not found
     */
    404: unknown;
};

export type SerenCloudGetDeploymentBundleDownloadResponses = {
    /**
     * Deployment bundle download instructions
     */
    200: DataResponseCloudDeploymentBundleDownloadResponse;
};

export type SerenCloudGetDeploymentBundleDownloadResponse = SerenCloudGetDeploymentBundleDownloadResponses[keyof SerenCloudGetDeploymentBundleDownloadResponses];

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

export type SerenCloudGetDeploymentEvalDriftErrors = {
    /**
     * Deployment has no eval gate configured
     */
    400: unknown;
    /**
     * Not found
     */
    404: unknown;
};

export type SerenCloudGetDeploymentEvalDriftResponses = {
    /**
     * Drift snapshot
     */
    200: DataResponseCloudDeploymentEvalDrift;
};

export type SerenCloudGetDeploymentEvalDriftResponse = SerenCloudGetDeploymentEvalDriftResponses[keyof SerenCloudGetDeploymentEvalDriftResponses];

export type SerenCloudDeploymentPendingApprovalsData = {
    body?: never;
    path: {
        /**
         * Deployment ID
         */
        id: string;
    };
    query?: {
        /**
         * Max runs to return (default: 50, max: 100)
         */
        limit?: number;
        /**
         * Pagination offset (default: 0)
         */
        offset?: number;
        /**
         * Filter by compute backend (aws_container, cloudflare_worker, daytona)
         */
        compute_backend?: string;
        /**
         * Filter by run source (api, cli, scheduler, ui, system, unknown)
         */
        source?: string;
        /**
         * Filter runs by artifact existence
         */
        has_artifacts?: boolean;
        /**
         * Filter runs started at/after RFC3339 timestamp
         */
        started_after?: string;
        /**
         * Filter runs started at/before RFC3339 timestamp
         */
        started_before?: string;
        /**
         * Case-insensitive search across execution_id, status, source, run_name, output, metadata
         */
        q?: string;
    };
    url: '/deployments/{id}/pending_approvals';
};

export type SerenCloudDeploymentPendingApprovalsErrors = {
    /**
     * Not found
     */
    404: unknown;
};

export type SerenCloudDeploymentPendingApprovalsResponses = {
    /**
     * Awaiting-approval runs listed
     */
    200: DataResponseVecCloudPendingApprovalRun;
};

export type SerenCloudDeploymentPendingApprovalsResponse = SerenCloudDeploymentPendingApprovalsResponses[keyof SerenCloudDeploymentPendingApprovalsResponses];

export type SerenCloudDeploymentRunsData = {
    body?: never;
    path: {
        /**
         * Deployment ID
         */
        id: string;
    };
    query?: {
        /**
         * Max runs to return (default: 50, max: 100)
         */
        limit?: number;
        /**
         * Pagination offset (default: 0)
         */
        offset?: number;
        /**
         * Repeat or comma-separate statuses: queued, running, awaiting_approval, completed, failed, cancelled, timeout, blocked, error
         */
        status?: string;
        /**
         * Filter by compute backend (aws_container, cloudflare_worker, daytona)
         */
        compute_backend?: string;
        /**
         * Filter by run source (api, cli, scheduler, ui, system, unknown)
         */
        source?: string;
        /**
         * Filter runs by artifact existence
         */
        has_artifacts?: boolean;
        /**
         * Filter runs started at/after RFC3339 timestamp
         */
        started_after?: string;
        /**
         * Filter runs started at/before RFC3339 timestamp
         */
        started_before?: string;
        /**
         * Case-insensitive search across execution_id, status, source, run_name, output, metadata
         */
        q?: string;
    };
    url: '/deployments/{id}/runs';
};

export type SerenCloudDeploymentRunsErrors = {
    /**
     * Not found
     */
    404: unknown;
};

export type SerenCloudDeploymentRunsResponses = {
    /**
     * Runs listed
     */
    200: DataResponseVecCloudDeploymentRunEvent;
};

export type SerenCloudDeploymentRunsResponse = SerenCloudDeploymentRunsResponses[keyof SerenCloudDeploymentRunsResponses];

export type SerenCloudRunData = {
    body?: null | CloudDeploymentRunRequest;
    path: {
        /**
         * Deployment ID
         */
        id: string;
    };
    query?: never;
    url: '/deployments/{id}/runs';
};

export type SerenCloudRunErrors = {
    /**
     * Insufficient SerenBucks balance
     */
    402: unknown;
    /**
     * Not found
     */
    404: unknown;
};

export type SerenCloudRunResponses = {
    /**
     * Run completed (always_on deployments)
     */
    200: DataResponseCloudDeploymentRunInvocationResponse;
    /**
     * Run triggered
     */
    202: DataResponseCloudDeploymentRunInvocationResponse;
};

export type SerenCloudRunResponse = SerenCloudRunResponses[keyof SerenCloudRunResponses];

export type SerenCloudDeploymentRunData = {
    body?: never;
    path: {
        /**
         * Deployment ID
         */
        id: string;
        /**
         * Run event ID
         */
        run_id: string;
    };
    query?: never;
    url: '/deployments/{id}/runs/{run_id}';
};

export type SerenCloudDeploymentRunErrors = {
    /**
     * Not found
     */
    404: unknown;
};

export type SerenCloudDeploymentRunResponses = {
    /**
     * Run event details
     */
    200: DataResponseCloudDeploymentRunEvent;
};

export type SerenCloudDeploymentRunResponse = SerenCloudDeploymentRunResponses[keyof SerenCloudDeploymentRunResponses];

export type SerenCloudDeploymentRunArtifactsData = {
    body?: never;
    path: {
        /**
         * Deployment ID
         */
        id: string;
        /**
         * Run event ID
         */
        run_id: string;
    };
    query?: {
        /**
         * Max artifacts to return (default: 50, max: 200)
         */
        limit?: number;
        /**
         * Pagination offset (default: 0)
         */
        offset?: number;
    };
    url: '/deployments/{id}/runs/{run_id}/artifacts';
};

export type SerenCloudDeploymentRunArtifactsErrors = {
    /**
     * Not found
     */
    404: unknown;
};

export type SerenCloudDeploymentRunArtifactsResponses = {
    /**
     * Run artifacts listed
     */
    200: DataResponseVecCloudDeploymentRunArtifact;
};

export type SerenCloudDeploymentRunArtifactsResponse = SerenCloudDeploymentRunArtifactsResponses[keyof SerenCloudDeploymentRunArtifactsResponses];

export type SerenCloudDeploymentRunCancelData = {
    body?: never;
    path: {
        /**
         * Deployment ID
         */
        id: string;
        /**
         * Run event ID
         */
        run_id: string;
    };
    query?: never;
    url: '/deployments/{id}/runs/{run_id}/cancel';
};

export type SerenCloudDeploymentRunCancelErrors = {
    /**
     * Not found
     */
    404: unknown;
};

export type SerenCloudDeploymentRunCancelResponses = {
    /**
     * Run cancellation requested
     */
    200: DataResponseCloudDeploymentRunEvent;
};

export type SerenCloudDeploymentRunCancelResponse = SerenCloudDeploymentRunCancelResponses[keyof SerenCloudDeploymentRunCancelResponses];

export type SerenCloudDeploymentRunEvalsData = {
    body?: never;
    path: {
        /**
         * Deployment ID
         */
        id: string;
        /**
         * Run event ID
         */
        run_id: string;
    };
    query?: never;
    url: '/deployments/{id}/runs/{run_id}/evals';
};

export type SerenCloudDeploymentRunEvalsErrors = {
    /**
     * Not found
     */
    404: unknown;
};

export type SerenCloudDeploymentRunEvalsResponses = {
    /**
     * Eval records linked to the run
     */
    200: DataResponseCloudRunEvalsResponse;
};

export type SerenCloudDeploymentRunEvalsResponse = SerenCloudDeploymentRunEvalsResponses[keyof SerenCloudDeploymentRunEvalsResponses];

export type SerenCloudDeploymentRunEventsData = {
    body?: never;
    path: {
        /**
         * Deployment ID
         */
        id: string;
        /**
         * Run event ID
         */
        run_id: string;
    };
    query?: {
        /**
         * Max events to return (default: 100, max: 500)
         */
        limit?: number;
        /**
         * Pagination offset (default: 0)
         */
        offset?: number;
        /**
         * Filter by event kind (text, thinking, tool_call_started, tool_call_completed, tool_audit, workflow, error, unknown)
         */
        kind?: string;
        /**
         * Filter by tool/output item ID
         */
        item_id?: string;
        /**
         * Case-insensitive search across event type, kind, item ID, and payload
         */
        q?: string;
    };
    url: '/deployments/{id}/runs/{run_id}/events';
};

export type SerenCloudDeploymentRunEventsErrors = {
    /**
     * Not found
     */
    404: unknown;
};

export type SerenCloudDeploymentRunEventsResponses = {
    /**
     * Run output events listed
     */
    200: DataResponseVecCloudRunOutputEventEnvelope;
};

export type SerenCloudDeploymentRunEventsResponse = SerenCloudDeploymentRunEventsResponses[keyof SerenCloudDeploymentRunEventsResponses];

export type SerenCloudDeploymentRunPendingApprovalsData = {
    body?: never;
    path: {
        /**
         * Deployment ID
         */
        id: string;
        /**
         * Run event ID
         */
        run_id: string;
    };
    query?: never;
    url: '/deployments/{id}/runs/{run_id}/pending_approvals';
};

export type SerenCloudDeploymentRunPendingApprovalsErrors = {
    /**
     * Not found
     */
    404: unknown;
};

export type SerenCloudDeploymentRunPendingApprovalsResponses = {
    /**
     * Current pending approvals for the run
     */
    200: DataResponseCloudRunPendingApprovalsResponse;
};

export type SerenCloudDeploymentRunPendingApprovalsResponse = SerenCloudDeploymentRunPendingApprovalsResponses[keyof SerenCloudDeploymentRunPendingApprovalsResponses];

export type SerenCloudDeploymentRunStreamCloseData = {
    body?: never;
    headers: {
        /**
         * Active stream session ID to close
         */
        'x-seren-stream-session-id': string;
    };
    path: {
        /**
         * Deployment ID
         */
        id: string;
        /**
         * Run event ID
         */
        run_id: string;
    };
    query?: never;
    url: '/deployments/{id}/runs/{run_id}/stream';
};

export type SerenCloudDeploymentRunStreamCloseErrors = {
    /**
     * Not found
     */
    404: unknown;
};

export type SerenCloudDeploymentRunStreamCloseResponses = {
    /**
     * Stream session closed
     */
    200: DataResponseCloudRunStreamCloseResponse;
};

export type SerenCloudDeploymentRunStreamCloseResponse = SerenCloudDeploymentRunStreamCloseResponses[keyof SerenCloudDeploymentRunStreamCloseResponses];

export type SerenCloudDeploymentRunStreamData = {
    body?: never;
    path: {
        /**
         * Deployment ID
         */
        id: string;
        /**
         * Run event ID
         */
        run_id: string;
    };
    query?: never;
    url: '/deployments/{id}/runs/{run_id}/stream';
};

export type SerenCloudDeploymentRunStreamErrors = {
    /**
     * Not found
     */
    404: unknown;
};

export type SerenCloudDeploymentRunStreamResponses = {
    /**
     * SSE stream of run updates
     */
    200: unknown;
};

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

export type SerenCloudGetDeploymentSpendErrors = {
    /**
     * Not found
     */
    404: unknown;
};

export type SerenCloudGetDeploymentSpendResponses = {
    /**
     * Aggregated spend summary
     */
    200: DataResponseDeploymentSpendSummary;
};

export type SerenCloudGetDeploymentSpendResponse = SerenCloudGetDeploymentSpendResponses[keyof SerenCloudGetDeploymentSpendResponses];

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

export type SerenCloudStartErrors = {
    /**
     * Bad request (not always_on)
     */
    400: unknown;
    /**
     * Insufficient SerenBucks balance
     */
    402: unknown;
};

export type SerenCloudStartResponses = {
    /**
     * Deployment started
     */
    200: DataResponseCloudDeploymentActionStatusResponse;
};

export type SerenCloudStartResponse = SerenCloudStartResponses[keyof SerenCloudStartResponses];

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

export type SerenCloudStopErrors = {
    /**
     * Bad request (not always_on)
     */
    400: unknown;
};

export type SerenCloudStopResponses = {
    /**
     * Deployment stopped
     */
    200: DataResponseCloudDeploymentActionStatusResponse;
};

export type SerenCloudStopResponse = SerenCloudStopResponses[keyof SerenCloudStopResponses];

export type SerenCloudListEnvironmentsData = {
    body?: never;
    path?: never;
    query?: never;
    url: '/environments';
};

export type SerenCloudListEnvironmentsResponses = {
    /**
     * Environments listed
     */
    200: DataResponseVecCloudDeploymentEnvironment;
};

export type SerenCloudListEnvironmentsResponse = SerenCloudListEnvironmentsResponses[keyof SerenCloudListEnvironmentsResponses];

export type SerenCloudCreateEnvironmentData = {
    body: CreateCloudDeploymentEnvironmentRequest;
    path?: never;
    query?: never;
    url: '/environments';
};

export type SerenCloudCreateEnvironmentErrors = {
    /**
     * Bad request
     */
    400: unknown;
};

export type SerenCloudCreateEnvironmentResponses = {
    /**
     * Environment created
     */
    200: DataResponseCloudDeploymentEnvironment;
};

export type SerenCloudCreateEnvironmentResponse = SerenCloudCreateEnvironmentResponses[keyof SerenCloudCreateEnvironmentResponses];

export type SerenCloudDeleteEnvironmentData = {
    body?: never;
    path: {
        /**
         * Environment ID
         */
        id: string;
    };
    query?: never;
    url: '/environments/{id}';
};

export type SerenCloudDeleteEnvironmentErrors = {
    /**
     * Not found
     */
    404: unknown;
};

export type SerenCloudDeleteEnvironmentResponses = {
    /**
     * Environment deleted
     */
    204: void;
};

export type SerenCloudDeleteEnvironmentResponse = SerenCloudDeleteEnvironmentResponses[keyof SerenCloudDeleteEnvironmentResponses];

export type SerenCloudGetEnvironmentData = {
    body?: never;
    path: {
        /**
         * Environment ID
         */
        id: string;
    };
    query?: never;
    url: '/environments/{id}';
};

export type SerenCloudGetEnvironmentErrors = {
    /**
     * Not found
     */
    404: unknown;
};

export type SerenCloudGetEnvironmentResponses = {
    /**
     * Environment details
     */
    200: DataResponseCloudDeploymentEnvironment;
};

export type SerenCloudGetEnvironmentResponse = SerenCloudGetEnvironmentResponses[keyof SerenCloudGetEnvironmentResponses];

export type SerenCloudUpdateEnvironmentData = {
    body: UpdateCloudDeploymentEnvironmentRequest;
    path: {
        /**
         * Environment ID
         */
        id: string;
    };
    query?: never;
    url: '/environments/{id}';
};

export type SerenCloudUpdateEnvironmentErrors = {
    /**
     * Not found
     */
    404: unknown;
};

export type SerenCloudUpdateEnvironmentResponses = {
    /**
     * Environment updated
     */
    200: DataResponseCloudDeploymentEnvironment;
};

export type SerenCloudUpdateEnvironmentResponse = SerenCloudUpdateEnvironmentResponses[keyof SerenCloudUpdateEnvironmentResponses];

export type SerenCloudEvalSetsData = {
    body?: never;
    path?: never;
    query?: {
        /**
         * Optional deployment scope
         */
        deployment_id?: string;
        /**
         * Max eval sets to return (default: 50, max: 200)
         */
        limit?: number;
        /**
         * Pagination offset
         */
        offset?: number;
    };
    url: '/eval-sets';
};

export type SerenCloudEvalSetsResponses = {
    /**
     * Eval sets listed
     */
    200: DataResponseVecCloudEvalSet;
};

export type SerenCloudEvalSetsResponse = SerenCloudEvalSetsResponses[keyof SerenCloudEvalSetsResponses];

export type SerenCloudCreateEvalSetData = {
    body: CreateCloudEvalSetRequest;
    path?: never;
    query?: never;
    url: '/eval-sets';
};

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

export type SerenCloudCreateEvalSetResponses = {
    /**
     * Eval set created
     */
    201: DataResponseCloudEvalSet;
};

export type SerenCloudCreateEvalSetResponse = SerenCloudCreateEvalSetResponses[keyof SerenCloudCreateEvalSetResponses];

export type SerenCloudGetEvalSetData = {
    body?: never;
    path: {
        /**
         * Eval set ID
         */
        id: string;
    };
    query?: never;
    url: '/eval-sets/{id}';
};

export type SerenCloudGetEvalSetErrors = {
    /**
     * Eval set not found
     */
    404: unknown;
};

export type SerenCloudGetEvalSetResponses = {
    /**
     * Eval set details
     */
    200: DataResponseCloudEvalSet;
};

export type SerenCloudGetEvalSetResponse = SerenCloudGetEvalSetResponses[keyof SerenCloudGetEvalSetResponses];

export type SerenCloudUpdateEvalSetData = {
    body: UpdateCloudEvalSetRequest;
    path: {
        /**
         * Eval set ID
         */
        id: string;
    };
    query?: never;
    url: '/eval-sets/{id}';
};

export type SerenCloudUpdateEvalSetErrors = {
    /**
     * Bad request
     */
    400: unknown;
    /**
     * Eval set or deployment not found
     */
    404: unknown;
};

export type SerenCloudUpdateEvalSetResponses = {
    /**
     * Eval set updated
     */
    200: DataResponseCloudEvalSet;
};

export type SerenCloudUpdateEvalSetResponse = SerenCloudUpdateEvalSetResponses[keyof SerenCloudUpdateEvalSetResponses];

export type SerenCloudEvalCasesData = {
    body?: never;
    path: {
        /**
         * Eval set ID
         */
        id: string;
    };
    query?: {
        /**
         * Max eval cases to return (default: 50, max: 200)
         */
        limit?: number;
        /**
         * Pagination offset
         */
        offset?: number;
    };
    url: '/eval-sets/{id}/cases';
};

export type SerenCloudEvalCasesErrors = {
    /**
     * Eval set not found
     */
    404: unknown;
};

export type SerenCloudEvalCasesResponses = {
    /**
     * Eval cases listed
     */
    200: DataResponseVecCloudEvalCase;
};

export type SerenCloudEvalCasesResponse = SerenCloudEvalCasesResponses[keyof SerenCloudEvalCasesResponses];

export type SerenCloudPromoteRunToEvalCaseData = {
    body: PromoteRunToCloudEvalCaseRequest;
    path: {
        /**
         * Eval set ID
         */
        id: string;
        /**
         * Source run event ID
         */
        run_id: string;
    };
    query?: never;
    url: '/eval-sets/{id}/cases/from-run/{run_id}';
};

export type SerenCloudPromoteRunToEvalCaseErrors = {
    /**
     * Bad request
     */
    400: unknown;
    /**
     * Eval set or run not found
     */
    404: unknown;
};

export type SerenCloudPromoteRunToEvalCaseResponses = {
    /**
     * Eval case created
     */
    201: DataResponseCloudEvalCase;
};

export type SerenCloudPromoteRunToEvalCaseResponse = SerenCloudPromoteRunToEvalCaseResponses[keyof SerenCloudPromoteRunToEvalCaseResponses];

export type SerenCloudGetEvalCaseData = {
    body?: never;
    path: {
        /**
         * Eval set ID
         */
        id: string;
        /**
         * Eval case ID
         */
        case_id: string;
    };
    query?: never;
    url: '/eval-sets/{id}/cases/{case_id}';
};

export type SerenCloudGetEvalCaseErrors = {
    /**
     * Eval case not found
     */
    404: unknown;
};

export type SerenCloudGetEvalCaseResponses = {
    /**
     * Eval case details
     */
    200: DataResponseCloudEvalCase;
};

export type SerenCloudGetEvalCaseResponse = SerenCloudGetEvalCaseResponses[keyof SerenCloudGetEvalCaseResponses];

export type SerenCloudEvalRunsData = {
    body?: never;
    path: {
        /**
         * Eval set ID
         */
        id: string;
    };
    query?: {
        /**
         * Max eval runs to return (default: 50, max: 200)
         */
        limit?: number;
        /**
         * Pagination offset
         */
        offset?: number;
    };
    url: '/eval-sets/{id}/runs';
};

export type SerenCloudEvalRunsErrors = {
    /**
     * Eval set not found
     */
    404: unknown;
};

export type SerenCloudEvalRunsResponses = {
    /**
     * Eval runs listed
     */
    200: DataResponseVecCloudEvalRun;
};

export type SerenCloudEvalRunsResponse = SerenCloudEvalRunsResponses[keyof SerenCloudEvalRunsResponses];

export type SerenCloudRunEvalSetData = {
    body: CreateCloudEvalRunRequest;
    path: {
        /**
         * Eval set ID
         */
        id: string;
    };
    query?: never;
    url: '/eval-sets/{id}/runs';
};

export type SerenCloudRunEvalSetErrors = {
    /**
     * Bad request
     */
    400: unknown;
    /**
     * Eval set or deployment not found
     */
    404: unknown;
};

export type SerenCloudRunEvalSetResponses = {
    /**
     * Eval run accepted
     */
    202: DataResponseCloudEvalRun;
};

export type SerenCloudRunEvalSetResponse = SerenCloudRunEvalSetResponses[keyof SerenCloudRunEvalSetResponses];

export type SerenCloudGetEvalRunData = {
    body?: never;
    path: {
        /**
         * Eval set ID
         */
        id: string;
        /**
         * Eval run ID
         */
        run_id: string;
    };
    query?: never;
    url: '/eval-sets/{id}/runs/{run_id}';
};

export type SerenCloudGetEvalRunErrors = {
    /**
     * Eval run not found
     */
    404: unknown;
};

export type SerenCloudGetEvalRunResponses = {
    /**
     * Eval run details
     */
    200: DataResponseCloudEvalRun;
};

export type SerenCloudGetEvalRunResponse = SerenCloudGetEvalRunResponses[keyof SerenCloudGetEvalRunResponses];

export type SerenCloudEvalRunResultsData = {
    body?: never;
    path: {
        /**
         * Eval set ID
         */
        id: string;
        /**
         * Eval run ID
         */
        run_id: string;
    };
    query?: {
        /**
         * Max case results to return (default: 50, max: 200)
         */
        limit?: number;
        /**
         * Pagination offset
         */
        offset?: number;
    };
    url: '/eval-sets/{id}/runs/{run_id}/results';
};

export type SerenCloudEvalRunResultsErrors = {
    /**
     * Eval run not found
     */
    404: unknown;
};

export type SerenCloudEvalRunResultsResponses = {
    /**
     * Eval case results listed
     */
    200: DataResponseVecCloudEvalCaseResult;
};

export type SerenCloudEvalRunResultsResponse = SerenCloudEvalRunResultsResponses[keyof SerenCloudEvalRunResultsResponses];

export type SerenCloudGetEvalCaseResultData = {
    body?: never;
    path: {
        /**
         * Eval set ID
         */
        id: string;
        /**
         * Eval run ID
         */
        run_id: string;
        /**
         * Eval case ID
         */
        case_id: string;
    };
    query?: never;
    url: '/eval-sets/{id}/runs/{run_id}/results/{case_id}';
};

export type SerenCloudGetEvalCaseResultErrors = {
    /**
     * Eval case result not found
     */
    404: unknown;
};

export type SerenCloudGetEvalCaseResultResponses = {
    /**
     * Eval case result details
     */
    200: DataResponseCloudEvalCaseResult;
};

export type SerenCloudGetEvalCaseResultResponse = SerenCloudGetEvalCaseResultResponses[keyof SerenCloudGetEvalCaseResultResponses];

export type SerenCloudApprovalInboxListData = {
    body?: never;
    path?: never;
    query?: {
        /**
         * Max entries per page (default: 50, max: 100)
         */
        limit?: number;
        /**
         * Opaque cursor from a previous response. Cursors expire after 24h; reject malformed or expired cursors with 400.
         */
        cursor?: string;
    };
    url: '/inbox/approvals';
};

export type SerenCloudApprovalInboxListErrors = {
    /**
     * Malformed limit or cursor
     */
    400: unknown;
    /**
     * Unauthorized
     */
    401: unknown;
};

export type SerenCloudApprovalInboxListResponses = {
    /**
     * Approval inbox entries
     */
    200: DataResponseApprovalInboxListResponse;
};

export type SerenCloudApprovalInboxListResponse = SerenCloudApprovalInboxListResponses[keyof SerenCloudApprovalInboxListResponses];

export type SerenCloudApprovalInboxDecideData = {
    body: ApprovalInboxDecisionRequest;
    path: {
        /**
         * Inbox-scoped entry id (e.g. tool:<run>:<call_id>)
         */
        entry_id: string;
    };
    query?: never;
    url: '/inbox/approvals/{entry_id}/decide';
};

export type SerenCloudApprovalInboxDecideErrors = {
    /**
     * Malformed body
     */
    400: unknown;
    /**
     * Unauthorized
     */
    401: unknown;
    /**
     * Forbidden
     */
    403: unknown;
    /**
     * Inbox entry not found
     */
    404: unknown;
    /**
     * Entry no longer pending
     */
    409: unknown;
};

export type SerenCloudApprovalInboxDecideResponses = {
    /**
     * Decision recorded
     */
    200: DataResponseApprovalInboxDecisionResponse;
};

export type SerenCloudApprovalInboxDecideResponse = SerenCloudApprovalInboxDecideResponses[keyof SerenCloudApprovalInboxDecideResponses];

export type SerenCloudPendingApprovalsData = {
    body?: never;
    path?: never;
    query?: {
        /**
         * Max runs to return (default: 50, max: 100)
         */
        limit?: number;
        /**
         * Pagination offset (default: 0)
         */
        offset?: number;
        /**
         * Filter by compute backend (aws_container, cloudflare_worker, daytona)
         */
        compute_backend?: string;
        /**
         * Filter by run source (api, cli, scheduler, ui, system, unknown)
         */
        source?: string;
        /**
         * Filter runs by artifact existence
         */
        has_artifacts?: boolean;
        /**
         * Filter runs started at/after RFC3339 timestamp
         */
        started_after?: string;
        /**
         * Filter runs started at/before RFC3339 timestamp
         */
        started_before?: string;
        /**
         * Case-insensitive search across execution_id, status, source, run_name, output, metadata
         */
        q?: string;
    };
    url: '/pending_approvals';
};

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

export type SerenCloudPendingApprovalsResponses = {
    /**
     * Awaiting-approval runs listed
     */
    200: DataResponseVecCloudPendingApprovalRun;
};

export type SerenCloudPendingApprovalsResponse = SerenCloudPendingApprovalsResponses[keyof SerenCloudPendingApprovalsResponses];

export type SerenCloudRunsData = {
    body?: never;
    path?: never;
    query?: {
        /**
         * Max runs to return (default: 50, max: 100)
         */
        limit?: number;
        /**
         * Pagination offset (default: 0)
         */
        offset?: number;
        /**
         * Repeat or comma-separate statuses: queued, running, awaiting_approval, completed, failed, cancelled, timeout, blocked, error
         */
        status?: string;
        /**
         * Filter by compute backend (aws_container, cloudflare_worker, daytona)
         */
        compute_backend?: string;
        /**
         * Filter by run source (api, cli, scheduler, ui, system, unknown)
         */
        source?: string;
        /**
         * Filter runs by artifact existence
         */
        has_artifacts?: boolean;
        /**
         * Filter runs started at/after RFC3339 timestamp
         */
        started_after?: string;
        /**
         * Filter runs started at/before RFC3339 timestamp
         */
        started_before?: string;
        /**
         * Case-insensitive search across execution_id, status, source, run_name, output, metadata
         */
        q?: string;
    };
    url: '/runs';
};

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

export type SerenCloudRunsResponses = {
    /**
     * All runs listed
     */
    200: DataResponseVecCloudDeploymentRunEvent;
};

export type SerenCloudRunsResponse = SerenCloudRunsResponses[keyof SerenCloudRunsResponses];

export type SerenCloudRunDetailData = {
    body?: never;
    path: {
        /**
         * Run event ID
         */
        run_id: string;
    };
    query?: never;
    url: '/runs/{run_id}';
};

export type SerenCloudRunDetailErrors = {
    /**
     * Not found
     */
    404: unknown;
};

export type SerenCloudRunDetailResponses = {
    /**
     * Run event details
     */
    200: DataResponseCloudDeploymentRunEvent;
};

export type SerenCloudRunDetailResponse = SerenCloudRunDetailResponses[keyof SerenCloudRunDetailResponses];

export type SerenCloudRunArtifactsData = {
    body?: never;
    path: {
        /**
         * Run event ID
         */
        run_id: string;
    };
    query?: {
        /**
         * Max artifacts to return (default: 50, max: 200)
         */
        limit?: number;
        /**
         * Pagination offset (default: 0)
         */
        offset?: number;
    };
    url: '/runs/{run_id}/artifacts';
};

export type SerenCloudRunArtifactsErrors = {
    /**
     * Not found
     */
    404: unknown;
};

export type SerenCloudRunArtifactsResponses = {
    /**
     * Run artifacts listed
     */
    200: DataResponseVecCloudDeploymentRunArtifact;
};

export type SerenCloudRunArtifactsResponse = SerenCloudRunArtifactsResponses[keyof SerenCloudRunArtifactsResponses];

export type SerenCloudRunAuditData = {
    body?: never;
    path: {
        /**
         * Run event ID
         */
        run_id: string;
    };
    query?: {
        /**
         * Max audit entries to return (default: 50, max: 200)
         */
        limit?: number;
        /**
         * Pagination offset
         */
        offset?: number;
        /**
         * Filter by exact audit action
         */
        action?: string;
        /**
         * Case-insensitive search across action, actor, and details
         */
        q?: string;
    };
    url: '/runs/{run_id}/audit';
};

export type SerenCloudRunAuditErrors = {
    /**
     * Run event not found
     */
    404: unknown;
};

export type SerenCloudRunAuditResponses = {
    /**
     * Run audit entries listed
     */
    200: DataResponseVecAuditEntry;
};

export type SerenCloudRunAuditResponse = SerenCloudRunAuditResponses[keyof SerenCloudRunAuditResponses];

export type SerenCloudRunCancelData = {
    body?: never;
    path: {
        /**
         * Run event ID
         */
        run_id: string;
    };
    query?: never;
    url: '/runs/{run_id}/cancel';
};

export type SerenCloudRunCancelErrors = {
    /**
     * Not found
     */
    404: unknown;
};

export type SerenCloudRunCancelResponses = {
    /**
     * Run cancellation requested
     */
    200: DataResponseCloudDeploymentRunEvent;
};

export type SerenCloudRunCancelResponse = SerenCloudRunCancelResponses[keyof SerenCloudRunCancelResponses];

export type SerenCloudRunCompareData = {
    body?: never;
    path: {
        /**
         * Baseline run event ID
         */
        run_id: string;
        /**
         * Candidate run event ID
         */
        compare_run_id: string;
    };
    query?: never;
    url: '/runs/{run_id}/compare/{compare_run_id}';
};

export type SerenCloudRunCompareErrors = {
    /**
     * Not found
     */
    404: unknown;
};

export type SerenCloudRunCompareResponses = {
    /**
     * Replay comparison summary
     */
    200: DataResponseCloudRunReplayComparison;
};

export type SerenCloudRunCompareResponse = SerenCloudRunCompareResponses[keyof SerenCloudRunCompareResponses];

export type SerenCloudRunEvalsData = {
    body?: never;
    path: {
        /**
         * Run event ID
         */
        run_id: string;
    };
    query?: never;
    url: '/runs/{run_id}/evals';
};

export type SerenCloudRunEvalsErrors = {
    /**
     * Not found
     */
    404: unknown;
};

export type SerenCloudRunEvalsResponses = {
    /**
     * Eval records linked to the run
     */
    200: DataResponseCloudRunEvalsResponse;
};

export type SerenCloudRunEvalsResponse = SerenCloudRunEvalsResponses[keyof SerenCloudRunEvalsResponses];

export type SerenCloudRunEventsData = {
    body?: never;
    path: {
        /**
         * Run event ID
         */
        run_id: string;
    };
    query?: {
        /**
         * Max events to return (default: 100, max: 500)
         */
        limit?: number;
        /**
         * Pagination offset (default: 0)
         */
        offset?: number;
        /**
         * Filter by event kind (text, thinking, tool_call_started, tool_call_completed, tool_audit, workflow, error, unknown)
         */
        kind?: string;
        /**
         * Filter by tool/output item ID
         */
        item_id?: string;
        /**
         * Case-insensitive search across event type, kind, item ID, and payload
         */
        q?: string;
    };
    url: '/runs/{run_id}/events';
};

export type SerenCloudRunEventsErrors = {
    /**
     * Not found
     */
    404: unknown;
};

export type SerenCloudRunEventsResponses = {
    /**
     * Run output events listed
     */
    200: DataResponseVecCloudRunOutputEventEnvelope;
};

export type SerenCloudRunEventsResponse = SerenCloudRunEventsResponses[keyof SerenCloudRunEventsResponses];

export type SerenCloudRunPendingApprovalsData = {
    body?: never;
    path: {
        /**
         * Run event ID
         */
        run_id: string;
    };
    query?: never;
    url: '/runs/{run_id}/pending_approvals';
};

export type SerenCloudRunPendingApprovalsErrors = {
    /**
     * Not found
     */
    404: unknown;
};

export type SerenCloudRunPendingApprovalsResponses = {
    /**
     * Current pending approvals for the run
     */
    200: DataResponseCloudRunPendingApprovalsResponse;
};

export type SerenCloudRunPendingApprovalsResponse = SerenCloudRunPendingApprovalsResponses[keyof SerenCloudRunPendingApprovalsResponses];

export type SerenCloudRunStreamCloseData = {
    body?: never;
    headers: {
        /**
         * Active stream session ID to close
         */
        'x-seren-stream-session-id': string;
    };
    path: {
        /**
         * Run event ID
         */
        run_id: string;
    };
    query?: never;
    url: '/runs/{run_id}/stream';
};

export type SerenCloudRunStreamCloseErrors = {
    /**
     * Not found
     */
    404: unknown;
};

export type SerenCloudRunStreamCloseResponses = {
    /**
     * Stream session closed
     */
    200: DataResponseCloudRunStreamCloseResponse;
};

export type SerenCloudRunStreamCloseResponse = SerenCloudRunStreamCloseResponses[keyof SerenCloudRunStreamCloseResponses];

export type SerenCloudRunStreamData = {
    body?: never;
    path: {
        /**
         * Run event ID
         */
        run_id: string;
    };
    query?: never;
    url: '/runs/{run_id}/stream';
};

export type SerenCloudRunStreamErrors = {
    /**
     * Not found
     */
    404: unknown;
};

export type SerenCloudRunStreamResponses = {
    /**
     * SSE stream of run updates
     */
    200: unknown;
};
