import { Fetcher, apiRequest } from "./apiClient"; export interface JobCheckpoint { step: number; source: "local" | "hub"; ref: string; } export interface PolicyConfigSummary { policy_type: string | null; image_features: Record; requires_task: boolean; } export async function listJobCheckpoints( baseUrl: string, fetcher: Fetcher, jobId: string, signal?: AbortSignal, ): Promise { const body = await apiRequest<{ checkpoints: JobCheckpoint[] }>( baseUrl, fetcher, `/jobs/${jobId}/checkpoints`, { signal, action: "List checkpoints" }, ); return body.checkpoints; } export async function getCheckpointPolicyConfig( baseUrl: string, fetcher: Fetcher, jobId: string, step: number, signal?: AbortSignal, ): Promise { return apiRequest( baseUrl, fetcher, `/jobs/${jobId}/checkpoints/${step}/policy-config`, { signal, action: "Load policy config" }, ); }