import type { MsgContext } from "../../src/auto-reply/templating.js"; import { buildDispatchInboundCaptureMock } from "./dispatch-inbound-capture.js"; export type InboundContextCapture = { ctx: MsgContext | undefined; }; export function createInboundContextCapture(): InboundContextCapture { return { ctx: undefined }; } export async function buildDispatchInboundContextCapture( importOriginal: >() => Promise, capture: InboundContextCapture, ) { const actual = await importOriginal(); return buildDispatchInboundCaptureMock(actual, (ctx) => { capture.ctx = ctx as MsgContext; }); }