/**
* @fileoverview HTML rendering for the "Task lifecycle pipeline" section.
*
* Pure function — no I/O, no DOM, no globals. Easy to unit-test and to
* inject into the existing server-rendered task page.
*
* Output is HTML-escaped; no user content reaches the page unescaped.
*/
import type { CanonicalMilestoneType } from "./cli-tasks-adapter.js";
/** View model that the page actually consumes. */
export interface OperationViewModel {
id: number;
sequence: number;
milestoneType: CanonicalMilestoneType;
title: string;
description: string;
processDescription: string;
timestamp: string;
sessionShort: string;
}
/**
* v1.1.0+ SSE connection state for the pipeline header badge.
*
* - `stale` — orange — initial paint before SSE open
* - `connecting` — yellow — SSE handshake in flight
* - `live` — green — events flowing
* - `reconnecting` — yellow — SSE dropped, will retry
* - `error` — red — 3+ consecutive errors, polling fallback
*/
export type SseState = "stale" | "connecting" | "live" | "reconnecting" | "error";
export interface RenderPipelineInput {
operations?: OperationViewModel[];
/** When set, renders the error state with a retry button. */
error?: string;
/** Whether the data is from a stale cache (active task polling). */
stale?: boolean;
/** Optional task title for the section header. */
taskTitle?: string;
/**
* v1.1.0+ SSE connection state. When provided, takes precedence
* over the legacy `stale` boolean and renders the new state-aware
* badge (pipeline-stale / pipeline-connecting / pipeline-live /
* pipeline-reconnecting / pipeline-error). When omitted, the legacy
* `pipeline-stale` orange pill is used for backward compatibility
* with v0.9.x.
*/
sseState?: SseState;
/**
* Numeric task id for this pipeline. When set, the rendered
* `` carries `data-task-id=""` so the
* client-side `boot()` in `public/task-operations.js` can read it and
* instantiate the PipelineController. Without this attribute the
* controller silently bails (intentional defence against
* accidentally hydrating on the index page).
*
* Must be a positive integer; non-numeric values are ignored (the
* attribute is simply omitted) so a bad input can never break HTML
* escaping or attribute quoting.
*/
taskId?: number;
}
/** Map canonical milestone type → CSS class for color-coding. */
export declare function statusClass(type: CanonicalMilestoneType | string): string;
/** Human-friendly label for a milestone type. */
export declare function statusLabel(type: CanonicalMilestoneType | string): string;
/** Format an ISO timestamp as a short, locale-friendly string. */
export declare function fmtTs(ts: string): string;
export declare function renderOperationsPipeline(input: RenderPipelineInput): string;
//# sourceMappingURL=task-operations-html.d.ts.map