import type { PlayRunLifecycleStatus } from './run-lifecycle-policy'; import type { PlayDocflowNodeIoState } from './docflow-node-io'; import type { PlayActivityObservation, PlayRunActivityProjection, } from './activity-observation'; export type PlayRunLiveStatus = PlayRunLifecycleStatus; export type PlayVisualNodeStatus = | 'idle' | 'running' | 'completed' | 'failed' | 'skipped'; export type PlayStepLiveStatus = Exclude; export type PlayVisualNodeProgressSnapshot = { completed?: number; total?: number; failed?: number; startedRows?: number; activeRows?: number; waitingRows?: number; completedRows?: number; message?: string; updatedAt?: number | null; startedAt?: number | null; completedAt?: number | null; artifactTableNamespace?: string | null; nodeIo?: PlayDocflowNodeIoState; }; /** * Observed provider usage for one graph node (ADR 0018). Server-computed at * read time from the Runtime Sheet producer trace plus the node-scoped usage * events; never derived in the browser and never from event counters. */ export type PlayVisualNodeToolUsageSnapshot = { toolId: string; provider: string; column?: string | null; /** Per-row logical invocations, including losing cascade legs. */ logicalCalls: number; /** Physical provider requests (one native batch answers many rows). */ providerRequests: number; winningCells: number; reusedCells: number; failedCalls: number; credits: number; deeplineCostUsd: number; durationMsTotal: number | null; }; export type PlayVisualNodeUsageSnapshot = { tools: PlayVisualNodeToolUsageSnapshot[]; totalCredits: number; totalProviderRequests: number; totalLogicalCalls: number; totalDurationMs: number | null; }; export type PlayVisualNodeStateSnapshot = { nodeId: string; status: PlayVisualNodeStatus; error?: string | null; artifactTableNamespace?: string | null; progress?: PlayVisualNodeProgressSnapshot | null; startedAt?: number | null; completedAt?: number | null; updatedAt?: number | null; nodeIo?: PlayDocflowNodeIoState; usage?: PlayVisualNodeUsageSnapshot; }; export type PlayRunLiveSnapshot = { runId: string; status: PlayRunLiveStatus; updatedAt: number | null; logs: string[]; activeArtifactTableNamespace: string | null; resultTableNamespace: string | null; nodeStates: PlayVisualNodeStateSnapshot[]; activeNodeId: string | null; activities?: PlayActivityObservation[]; activeActivity?: PlayActivityObservation | null; activity?: PlayRunActivityProjection | null; };