import { isProgressPhase } from '../progress-event.js';
/**
 * Adapts a workspace preparation progress event to the standard `ProgressEvent` shape,
 * so consumers can route prepare progress through generic `OnProgress` handlers.
 * Falls back to the `'start'` phase when neither `phase` nor a recognizable `stage` is present.
 */
export function prepareProgressToProgressEvent(event) {
    return {
        phase: event.phase ?? (isProgressPhase(event.stage) ? event.stage : 'start'),
        total: event.total,
        completed: event.completed,
        detail: event.detail,
        scope: event.scope,
        currentPath: event.currentPath,
        startedAt: event.startedAt,
        elapsedMs: event.elapsedMs,
    };
}
//# sourceMappingURL=prepare-types.js.map