/* tslint:disable */
/* eslint-disable */
/**
 * Fabro Run API
 * HTTP API for managing Fabro workflow run executions.
 *
 * The version of the OpenAPI document: 0.2.0
 *
 *
 * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
 * https://openapi-generator.tech
 * Do not edit the class manually.
 */


// May contain unused imports in some cases
// @ts-ignore
import type { BilledTokenCounts } from './billed-token-counts';
// May contain unused imports in some cases
// @ts-ignore
import type { StageHandler } from './stage-handler';
// May contain unused imports in some cases
// @ts-ignore
import type { StageModelUsage } from './stage-model-usage';
// May contain unused imports in some cases
// @ts-ignore
import type { StageState } from './stage-state';

/**
 * A single stage in a run\'s workflow graph.
 */
export interface RunStage {
    /**
     * Canonical stage execution identifier in `node_id@visit` form.
     */
    'id': string;
    /**
     * Human-readable stage name.
     */
    'name': string;
    'handler': StageHandler;
    'status': StageState;
    /**
     * Wall-clock time the latest attempt spent in this stage, in milliseconds.
     */
    'wall_time_ms'?: number;
    /**
     * Node id in the workflow graph; multiple stages with different visits share the same node_id.
     */
    'node_id': string;
    /**
     * 1-based stage execution ordinal, the numeric component of `id`. It increments each time the node produces a new observable execution: graph re-entry (loops) and replay of post-checkpoint work after resume. Automatic in-place retries do not increment it.
     */
    'visit': number;
    /**
     * 1-based count of how many times workflow control entered this node (drives `max_visits`). Differs from `visit` when a post-checkpoint execution is replayed after resume. Absent for stages recorded before execution identity was tracked.
     */
    'graph_visit'?: number | null;
    /**
     * Canonical stage execution identifier in `node_id@visit` form.
     */
    'resumed_from_stage_id'?: string | null;
    /**
     * Exact StageId of the parent parallel execution. Clients can compare this directly with the `id` of a parallel stage. Omitted for stages that are not parallel branches.
     */
    'parallel_group_id'?: string;
    /**
     * Zero-based outgoing-edge index within the parent parallel execution. Omitted for stages that are not parallel branches.
     */
    'parallel_branch_index'?: number;
    'provider_used'?: StageModelUsage | null;
    /**
     * Wall-clock time the latest attempt of this stage started, if known.
     */
    'started_at'?: string | null;
    /**
     * Token counts for this stage execution alone. `total_usd_micros` is the provider-reported cost when there is one, otherwise the server catalog\'s price for these tokens — the same pricing the `/runs/{id}/billing` rows use. All-zero counts mean the stage made no model calls. Unlike the billing rows, which sum every visit of a node, this covers only this visit.
     */
    'billing': BilledTokenCounts;
}
