async function arrayFromAsync(reader) {
  const array = [];
  for await (const chunk of reader) {
    // Capture current state, allocating a copy.
    array.push(chunk.slice());
  }
  return array;
}
@param {import('@endo/stream').Stream<T, U, V>} reader