feat: add connection middleware abstractions and framing helpers (#10136)