Custom response distribution - fitted stan function for mixture model

I have an alternative implementation of the zero and one inflated beta regression (that does not condition 1 on 0), and I am a bit in doubt as to how to specify the fitted_zero_one_inflated_beta2 R function, given the mixture nature of the model.
The tutorial says: " it has only a draws argument and should compute the mean response values for all observations at once", however, the mean response value is trickier in a mixture model. Any suggestion?

See https://github.com/paul-buerkner/brms/blob/master/R/fitted.R for how I do it in other zero-inflated models.

thanks! Given the zero and one parameters are now modeled separately, would I do

with(draws$dpars, mu * (1 - zero) + one )

instead of the original

with(draws$dpars, zoi * coi + mu * (1 - zoi))

?

Depends on how your likelihood looks like. But could it be more like

with(draws$dpars, mu * (1 - zero - one) + one)

?

Thanks again. After a few tests, that seems to do the trick.
Here is my code, just in case other people are interested: