export function completeAgent(jobId, agentName, status, error, deps) {
    const { progressGateway } = deps;
    const progress = progressGateway.completeAgent(jobId, agentName, status, error);
    if (!progress) {
        return {
            success: false,
            error: `Agent not found: ${agentName}`,
        };
    }
    const agent = progress.agents.find((a) => a.name === agentName);
    return {
        success: true,
        agentName,
        status: agent?.status ?? "completed",
        completedAt: agent?.completedAt ?? new Date(),
        overallProgress: progress.overallProgress,
        error: agent?.error,
    };
}
//# sourceMappingURL=completeAgent.usecase.js.map