// Serialize CodeBuddy SDK query() subprocesses — only one CLI at a time. let chain: Promise = Promise.resolve(); export function withSdkGate(fn: () => Promise): Promise { const run = chain.then(fn); chain = run.then(() => undefined, () => undefined); return run; }