histoire
Version:
A fast story book powered by Vite
27 lines • 1.77 kB
TypeScript
import type { ChangePlan, ChangeRequest } from '@histoire/shared';
import type { JobReceipt } from './receipt.js';
import type { ProjectSnapshot } from './snapshot.js';
/** Durable installed-version evidence paired with the pre-command file snapshot. */
export interface RepairReceipt extends JobReceipt {
/** Actual installed version before the job; never inferred from a manifest range. */ installedVersion?: string;
}
/** Recovery inputs captured before executing the original package command. */
interface DependencyRepair {
/** Project directory used by the original command. */ root: string;
/** Exact manifest and lockfile bytes captured before execution. */ snapshot: ProjectSnapshot;
/** Package intent whose installed state must be restored. */ request: ChangeRequest;
/** Detected manager from the verified plan. */ manager: ChangePlan['packageManager']['name'];
/** Reviewed argv, including any pnpm workspace flag. */ argv: string[];
/** Already resolved executable, reused without shell resolution. */ binary: string;
/** Installed version observed before the original package step. */ version?: string;
/** Fresh cancellation signal, independent of the original failed command. */ signal: AbortSignal;
/** Sanitized bounded job output sink. */ output: (text: string, stream: 'stdout' | 'stderr') => void;
/** Same environment used for the original package command. */ environment: NodeJS.ProcessEnv;
}
/** Repairs dependencies only against restored inputs, then proves installed state. */
export declare function repairDependencies(options: DependencyRepair): Promise<{
restored: boolean; /** Paths still requiring manual recovery. */
leftovers: string[];
}>;
export {};
//# sourceMappingURL=repair.d.ts.map