7d6a5c6de0
Bun's `Response(stream).bytes()` returns the raw `ArrayBuffer` once the body arrives in more than one chunk, which happens for subprocess stdout past ~128 KB. The public contract of `ptree.ChildProcess.bytes()` is `Promise<Uint8Array>`, and callers — most visibly the `ssh://` read path's `decodeUtf8Text` — rely on `Uint8Array` methods such as `.indexOf` and `.subarray`. On larger remote text files this surfaced as: TypeError: bytes.indexOf is not a function Normalize the result at the boundary: when `Response.bytes()` hands back an `ArrayBuffer`, wrap it in a zero-copy `Uint8Array` view before returning. Adds a regression test that drives a 256 KB stdout payload through `ptree.spawn(...).bytes()` and asserts the contract. Fixes #3712