AI SDK Internals

Vercel AI SDK internals as they matter for building production agents — three-layer API, lifecycle ordering, message reference model, prepareStep semantics. Based on ai@^6.