def METHOD_NAME(
    frame: dd.DataFrame,
    windowed: dd.rolling.Rolling,
    function: str,
    max_lookback: int,
    *args: tuple[Any],
    **kwargs: dict[str, Any],
) -> dd.Series:
    """Apply window aggregation with built-in aggregators."""
    assert isinstance(function, str)
    method = operator.methodcaller(function, *args, **kwargs)
    if max_lookback is not None:
        agg_method = method
        def sliced_agg(s):
            return agg_method(s.iloc[-max_lookback:])
        method = operator.methodcaller("apply", sliced_agg, raw=False)
    result = method(windowed)
    # No MultiIndex support in dask
    result.index = frame.index
    return result