/** * Save terminal-completed run outputs to disk via a path template. * * Convention follows `genmedia run --download` / `gh release download` / * Stripe CLI artifact templates: explicit template with `{var}` * placeholders, auto-create parent dirs, return per-output local paths * so callers can surface them in JSON envelopes. * * Supported placeholders in `template`: * {runId} — the run UUID * {index} — 0-based output index (REQUIRED when there are 2+ outputs * to prevent collisions) * {ext} — file extension inferred from URL pathname or `Content-Type` * {label} — slugified output label (apps surface meaningful labels; * recipes use the variant `styleHint`). Falls back to "output". * * Example: `--download "./out/{runId}_{index}.{ext}"`. * * Failed / non-image-url outputs are skipped silently; the caller's * non-JSON renderer can flag them. The return value is just the list * of downloads that actually completed. */ export interface RunOutput { id?: string; label?: string | null; type?: string | null; value?: unknown; status?: string | null; mimeType?: string | null; } export interface DownloadedFile { outputIndex: number; sourceUrl: string; localPath: string; bytes: number; } export declare function downloadOutputs({ runId, outputs, template, }: { runId: string; outputs: RunOutput[]; template: string; }): Promise;