import type { RuntimeSessionContext } from "../runtime/sessionContext.js"; type BackendContext = Pick< RuntimeSessionContext, "accessToken" | "projectId" | "traceId" >; export const buildBackendContextHeaders = ( context: BackendContext, ): Record => { const headers: Record = { Accept: "application/json", "Content-Type": "application/json", "X-Trace-Id": context.traceId, }; if (context.accessToken) { headers.Authorization = `Bearer ${context.accessToken}`; } if (context.projectId) { headers["X-Project-Id"] = context.projectId; } return headers; };