require(`./paths-Bcdg3ma0.cjs`),require(`./paths-a2-BgYPx.cjs`),require(`./sessions-Bc5xPyOc.cjs`);const e=require(`./logger-ElHF9OXJ.cjs`);require(`./proxy-env-BpF7ozPI.cjs`),require(`./github-copilot-token-zskwAEpd.cjs`);const t=require(`./audio-transcription-runner-C_k26IOs.cjs`);require(`./image-DXoZ4Tx8.cjs`),require(`./fetch-guard-CVK_RDgX.cjs`),require(`./api-key-rotation-BODuZKnL.cjs`),require(`./local-roots-BJwbkkZr.cjs`),require(`./proxy-fetch-DAxwIT4d.cjs`);async function n(n){let{ctx:r,cfg:i}=n,a=i.tools?.media?.audio;if(!a||a.enabled===!1)return;let o=t.i(r);if(!o||o.length===0)return;let s=o.find(e=>e&&t.p(e)&&!e.alreadyTranscribed);if(s){e.B()&&e.R(`audio-preflight: transcribing attachment ${s.index} for mention check`);try{let{transcript:a}=await t.t({ctx:r,cfg:i,attachments:o,agentDir:n.agentDir,providers:n.providers,activeModel:n.activeModel,localPathRoots:t.o({cfg:i,ctx:r})});return a?(s.alreadyTranscribed=!0,e.B()&&e.R(`audio-preflight: transcribed ${a.length} chars from attachment ${s.index}`),a):void 0}catch(t){e.B()&&e.R(`audio-preflight: transcription failed: ${String(t)}`);return}}}exports.transcribeFirstAudio=n;
