import { type JsonObject } from '../depot/shape.js'; import { type JobNode } from './ci-tree.js'; export declare function isTerminalState(state: string | undefined): boolean; /** True only when the state is known and not terminal: the job or workflow is still in flight. */ export declare function isActiveState(state: string | undefined): boolean; export interface StatefulNode { readonly status?: string | undefined; readonly conclusion?: string | undefined; } export declare function isFailedJob(job: StatefulNode): boolean; /** The best-effort state of a node: Depot sends a conclusion only once a status is terminal. */ export declare function nodeState(node: StatefulNode): string; export interface AttemptDetail { attemptId: string | undefined; attempt: number | undefined; status: string | undefined; conclusion: string | undefined; errorMessage: string | undefined; startedAt: string | undefined; finishedAt: string | undefined; durationSeconds: number | undefined; } export interface JobDetail { jobId: string | undefined; key: string | undefined; displayName: string | undefined; status: string | undefined; conclusion: string | undefined; errorMessage: string | undefined; runId: string | undefined; runStatus: string | undefined; workflowId: string | undefined; workflowName: string | undefined; workflowStatus: string | undefined; repo: string | undefined; currentAttempt: number | undefined; attemptCount: number; attempts: AttemptDetail[]; startedAt: string | undefined; finishedAt: string | undefined; durationSeconds: number | undefined; } /** * How many times a job has run. Depot reports both an attempt list and a `currentAttempt` * counter; the larger wins, so a truncated list cannot hide attempts from the retry cap. */ export declare function countAttempts(source: { readonly attempts: ReadonlyArray<{ readonly attempt: number | undefined; }>; readonly currentAttempt?: number | undefined; }): number; /** `GetJob` is flat: run, workflow and job fields side by side, prefixed by their owner. */ export declare function parseJobDetail(response: JsonObject): JobDetail; export interface WorkflowExecution { executionId: string | undefined; execution: number | undefined; status: string | undefined; startedAt: string | undefined; finishedAt: string | undefined; durationSeconds: number | undefined; } export interface WorkflowJob extends JobNode { attemptCount: number; startedAt: string | undefined; finishedAt: string | undefined; } export interface WorkflowDetail { workflowId: string | undefined; name: string | undefined; status: string | undefined; runId: string | undefined; runStatus: string | undefined; repo: string | undefined; ref: string | undefined; sha: string | undefined; executions: WorkflowExecution[]; jobs: WorkflowJob[]; startedAt: string | undefined; finishedAt: string | undefined; durationSeconds: number | undefined; } /** `GetWorkflow` is flat like `GetJob`, plus `executions` (rerun history) and nested `jobs`. */ export declare function parseWorkflowDetail(response: JsonObject): WorkflowDetail; /** * Depot does not document what its mutating RPCs return. Rather than assert a shape, gather * every id-looking string in the response (top level and nested, bounded) so the result can * name whatever Depot created or touched, and read a status if one is present. */ export declare function summariseMutationResponse(response: JsonObject): { ids: Record; status: string | undefined; keys: string[]; }; //# sourceMappingURL=ci-write-detail.d.ts.map