/** * Fetch pipeline stages as simple functions. * Each stage is responsible for one phase of the fetch lifecycle. * * Stages are composed in LaunchpadContent._executeFetchPipeline. */ import { ResultAsync } from "neverthrow"; import { ContentError } from "../content-transform.js"; import type { FetchStageContext } from "./fetch-context.js"; export type { FetchStageContext } from "./fetch-context.js"; /** * Error thrown during fetching of a specific source. */ export declare class ContentFetchError extends ContentError { sourceId: string; constructor(message: string, sourceId: string, cause?: Error); } /** * Error thrown during recovery process. */ export declare class ContentRecoveryError extends ContentError { originalError: ContentError; constructor(message: string, originalError: ContentError, cause?: Error); } /** * Stage 2: Back up existing downloads (optional). */ export declare function backupStage(context: FetchStageContext): ResultAsync; /** * Stage 3: Clear old downloads. */ export declare function clearOldDataStage(context: FetchStageContext): ResultAsync; /** * Stage 4: Fetch all sources in parallel. */ export declare function fetchSourcesStage(context: FetchStageContext): ResultAsync; /** * Stage 5: Run content transforms sequentially. * Each transform's temp path is namespaced to the transform name. */ export declare function runTransformsStage(context: FetchStageContext): ResultAsync; /** * Stage 6: Finalize (success path). */ export declare function finalizingStage(context: FetchStageContext): ResultAsync; /** * Stage 7: Handle errors and optionally restore from backup. */ export declare const errorRecoveryStage: (context: FetchStageContext, error: ContentError) => ResultAsync<{ restoredSourceIds: string[]; }, ContentError | ContentRecoveryError>; /** * Stage 7 (Final): Clean up temporary and backup directories. */ export declare const cleanupStage: (context: FetchStageContext, cleanup?: { temp?: boolean; backups?: boolean; }) => ResultAsync; //# sourceMappingURL=fetch-stages.d.ts.map