import { createRequire as __piCreateRequire } from "node:module"; const require = __piCreateRequire(import.meta.url);
function inferCopilotInitiator(messages){let last=messages[messages.length-1];return last&&last.role!=="user"?"agent":"user"}function hasCopilotVisionInput(messages){return messages.some(msg=>msg.role==="user"&&Array.isArray(msg.content)?msg.content.some(c=>c.type==="image"):msg.role==="toolResult"&&Array.isArray(msg.content)?msg.content.some(c=>c.type==="image"):!1)}function buildCopilotDynamicHeaders(params){let headers={"X-Initiator":inferCopilotInitiator(params.messages),"Openai-Intent":"conversation-edits"};return params.hasImages&&(headers["Copilot-Vision-Request"]="true"),headers}export{hasCopilotVisionInput,buildCopilotDynamicHeaders};
