/** * Pure model helpers for the jobs overlay. * * Kept free of UI/Component dependencies so the grouping/ordering and * detail-formatting logic is unit-testable. The selector controller wires these * SelectItem lists into nested SelectLists (list -> detail -> confirm). */ import type { SelectItem } from "@gajae-code/tui"; import type { JobsSnapshot } from "../jobs-observer"; export type JobRefKind = "monitor" | "cron"; export interface JobRef { kind: JobRefKind; id: string; } /** Compact relative time, e.g. "in 5m", "2m ago", "now". */ export declare function formatRelative(targetMs: number | undefined, nowMs?: number): string; /** Parse a list item value back into a job reference. */ export declare function parseJobRef(value: string): JobRef | null; /** * Build the grouped jobs list: monitors first (newest-first), then crons * (newest-first). The snapshot arrays are already sorted newest-first. */ export declare function buildJobsListItems(snapshot: JobsSnapshot): SelectItem[]; /** * Build the detail-level items for a job: read-only info rows (value "noop"), * then the destructive action, then a back row. `output` is the bounded monitor * output tail (ignored for cron jobs). */ export declare function buildJobDetailItems(snapshot: JobsSnapshot, ref: JobRef, output?: string): SelectItem[]; /** Yes/No confirm items for a destructive action. */ export declare function buildConfirmItems(actionLabel: string): SelectItem[];