export interface BackgroundTask { id: string; command: string; description?: string; /** * The server's real status. Never collapse these client-side: telling a user * that a cancelled or lost task is "done" is exactly the lie this replaced. * * `lost` means the platform stopped being able to track the process, not * that it failed — it may still be running. */ status: "starting" | "running" | "cancelling" | "succeeded" | "failed" | "cancelled" | "lost"; /** Set on `failed` to say why, e.g. `start_failed`, `log_budget_exceeded`. */ failure_reason?: string | null; exit_code?: number | null; elapsed_seconds: number; output_lines_count?: number; output_preview?: string[]; output?: string; log_path?: string | null; started_at?: number | null; finished_at?: number | null; } /** Outcome of a stop request. `ok: false` is a real answer, not an error. */ export interface BackgroundTaskStopResult { ok: boolean; message: string; /** Why the stop could not be confirmed, e.g. `still_running`, `probe_unknown`. */ reason?: string | null; task?: BackgroundTask | null; }