export function createWorkflowPhaseRelay(emit) {
    return {
        onPhaseStart: (step, phase, phaseName, instruction, promptParts, phaseExecutionId, iteration) => {
            if (phaseExecutionId == null && iteration == null) {
                emit('phase:start', step, phase, phaseName, instruction, promptParts);
                return;
            }
            emit('phase:start', step, phase, phaseName, instruction, promptParts, phaseExecutionId, iteration);
        },
        onPhaseComplete: (step, phase, phaseName, content, phaseStatus, error, phaseExecutionId, iteration) => {
            if (phaseExecutionId == null && iteration == null) {
                emit('phase:complete', step, phase, phaseName, content, phaseStatus, error);
                return;
            }
            emit('phase:complete', step, phase, phaseName, content, phaseStatus, error, phaseExecutionId, iteration);
        },
        onJudgeStage: (step, phase, phaseName, entry, phaseExecutionId, iteration) => {
            if (phaseExecutionId == null && iteration == null) {
                emit('phase:judge_stage', step, phase, phaseName, entry);
                return;
            }
            emit('phase:judge_stage', step, phase, phaseName, entry, phaseExecutionId, iteration);
        },
    };
}
//# sourceMappingURL=WorkflowEnginePhaseRelay.js.map