Trace Any TypeScript Agent Framework With Adapters A developer proposes an adapter-layer pattern to unify observability across TypeScript AI agent frameworks such as Vercel AI SDK, LangChain.js, and OpenAI Agents SDK. The approach translates framework-specific callbacks into a versioned trace model, with explicit capability flags to distinguish missing data from actual events. The design avoids leaking framework details into consumers and supports quality gates and telemetry export. TypeScript teams rarely standardize on one AI framework forever. One service may use Vercel AI SDK, another LangChain.js, another OpenAI Agents SDK, and a mature system may call provider clients directly. Those implementations expose different callback, telemetry, and streaming surfaces. Observability becomes expensive when every dashboard, test rule, and CI report understands each framework independently. An adapter layer isolates that variation. Framework-specific code captures source events; the adapter translates them into one versioned trace model; the rest of the system operates on normalized events. framework callbacks or wrappers | v framework adapter | v versioned trace events | | | v v v local UI CI gates telemetry export The goal is not to pretend every framework is identical. The goal is to preserve a common set of observable facts without leaking framework details into every consumer. A tempting interface is runWithTrace input - { result, events } . It works in a demo but creates several problems: A stronger boundary translates source events as they arrive and sends normalized events to the tracing core. Keep the shared model small, explicit, and versioned. type SpanKind = 'run' | 'model' | 'tool' | 'retrieval' | 'decision'; type TraceEvent = | { schemaVersion: 1; event: 'span started'; traceId: string; spanId: string; parentSpanId: string | null; name: string; kind: SpanKind; timestamp: string; attributes: Record