/* 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 { AgentControlState } from './agent-control-state';
// May contain unused imports in some cases
// @ts-ignore
import type { AgentToolSummary } from './agent-tool-summary';
// 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 { BillingModelRef } from './billing-model-ref';
// May contain unused imports in some cases
// @ts-ignore
import type { CommandTermination } from './command-termination';
// May contain unused imports in some cases
// @ts-ignore
import type { McpServerProjection } from './mcp-server-projection';
// May contain unused imports in some cases
// @ts-ignore
import type { ParallelBranchResult } from './parallel-branch-result';
// May contain unused imports in some cases
// @ts-ignore
import type { PermissionLevel } from './permission-level';
// May contain unused imports in some cases
// @ts-ignore
import type { SkillsProjection } from './skills-projection';
// May contain unused imports in some cases
// @ts-ignore
import type { StageCompletion } from './stage-completion';
// May contain unused imports in some cases
// @ts-ignore
import type { StageContextWindowProjection } from './stage-context-window-projection';
// May contain unused imports in some cases
// @ts-ignore
import type { StageInferenceProjection } from './stage-inference-projection';
// 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';
// May contain unused imports in some cases
// @ts-ignore
import type { StageTiming } from './stage-timing';
// May contain unused imports in some cases
// @ts-ignore
import type { StageToolBatchProjection } from './stage-tool-batch-projection';
// May contain unused imports in some cases
// @ts-ignore
import type { SubAgentProjection } from './sub-agent-projection';
// May contain unused imports in some cases
// @ts-ignore
import type { TodoListProjection } from './todo-list-projection';

/**
 * Observable projection data for one workflow stage execution.
 */
export interface StageProjection {
    'first_event_seq': number;
    'prompt'?: string | null;
    'response'?: string | null;
    'completion'?: StageCompletion | null;
    'provider_used'?: StageModelUsage | null;
    'diff'?: string | null;
    /**
     * Command and environment recorded when the stage script ran.
     */
    'script_invocation'?: object | null;
    /**
     * Wall-clock and step timing metadata for the stage script.
     */
    'script_timing'?: object | null;
    /**
     * Ordered per-branch results produced by a parallel stage.
     */
    'parallel_results'?: Array<ParallelBranchResult> | null;
    /**
     * Durable identity of one branch within a parallel execution, in `{parallel_group_id}:{index}` form.
     */
    'parallel_branch_id'?: string | null;
    'output'?: string | null;
    'output_bytes'?: number | null;
    'live_streaming'?: boolean | null;
    'termination'?: CommandTermination | null;
    /**
     * Wall-clock time the latest attempt of this stage started, if known.
     */
    'started_at'?: string | null;
    'timing'?: StageTiming | null;
    /**
     * Inference time accumulated from closed brackets during the current attempt. Live estimate only — the authoritative value arrives with the terminal event and lands in `timing`. Excludes the currently open bracket, whose span is measured from `inference.started_at`.
     */
    'live_inference_ms'?: number;
    /**
     * Tool time accumulated from closed tool batches during the current attempt. A batch spans the first dispatched call through the completion that drains the last outstanding one, so tools running concurrently within a turn are counted once.
     */
    'live_tool_ms'?: number;
    'tool_batch'?: StageToolBatchProjection | null;
    'usage': BilledTokenCounts;
    'model'?: BillingModelRef | null;
    'todos'?: TodoListProjection | null;
    /**
     * Subagents spawned by this stage, in replay/insertion order.
     */
    'subagents'?: Array<SubAgentProjection>;
    /**
     * Agent skills discovered and activated during this stage.
     */
    'skills'?: SkillsProjection;
    'permission_level'?: PermissionLevel | null;
    /**
     * Effective model-callable tools exposed to this agent stage session. Tool parameter schemas are intentionally omitted from this projection.
     */
    'agent_tools'?: Array<AgentToolSummary>;
    /**
     * MCP servers observed by this stage.
     */
    'mcp_servers'?: Array<McpServerProjection>;
    'context_window'?: StageContextWindowProjection | null;
    'inference'?: StageInferenceProjection | null;
    /**
     * Start of an external ACP agent process, if one is running. ACP agents do not expose Fabro\'s internal LLM brackets, so the process lifetime supplies their live inference estimate.
     */
    'acp_started_at'?: string | null;
    /**
     * Whether the agent is executing normally or waiting for steering after an interrupt.
     */
    'agent_control': AgentControlState;
    /**
     * Lifecycle state of the stage projection.
     */
    'state': StageState;
}
