import { acpToTrace } from "./trace.js";
export function createTraceSinkMiddleware(sink) {
    return async (ctx, next) => {
        try {
            await next();
        }
        finally {
            await sink(acpToTrace(ctx));
        }
    };
}
