require(`./paths-Bcdg3ma0.cjs`),require(`./paths-kh9_JTNM.cjs`),require(`./model-auth-Do7m_TFG.cjs`);const e=require(`./logger-CMTXcXUA.cjs`);require(`./proxy-env-CxZAYxjP.cjs`),require(`./github-copilot-token-CCrgp2py.cjs`);const t=require(`./audio-transcription-runner-fMbZtAQq.cjs`);require(`./image-Cvr9WcnD.cjs`),require(`./fetch-guard-CXw6J974.cjs`),require(`./api-key-rotation-DO552J9v.cjs`),require(`./local-roots-Dllvhgfy.cjs`),require(`./proxy-fetch-BRtmAK5t.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;
