export function transitionEvidenceToTransitionedPayload(evidence) {
    return {
        taskId: evidence.taskId,
        fromState: evidence.fromState,
        toState: evidence.toState,
        action: evidence.action,
        transitionId: evidence.transitionId,
        guardResults: evidence.guardResults.map((guard) => ({
            allowed: guard.allowed,
            guardName: guard.guardName,
            ...(guard.message?.trim() ? { reason: guard.message.trim() } : {})
        })),
        dependentsUnblocked: evidence.dependentsUnblocked,
        payloadDigest: evidence.payloadDigest
    };
}
export function mutationTypeToEventKind(mutationType) {
    switch (mutationType) {
        case "create-task":
        case "create-task-from-plan":
            return "task.created";
        case "update-task":
            return "task.updated";
        default:
            return null;
    }
}
