openclaw
Version:
Multi-channel AI gateway with extensible messaging integrations
3 lines • 1.15 kB
JavaScript
import{projectCopilotRequestFacts}from"@openclaw/ai/internal/shared";
//!src/agents/copilot-dynamic-headers.ts
const COPILOT_EDITOR_VERSION=`vscode/1.107.0`;const COPILOT_USER_AGENT=`GitHubCopilotChat/0.35.0`;const COPILOT_EDITOR_PLUGIN_VERSION=`copilot-chat/0.35.0`;const COPILOT_GITHUB_API_VERSION=`2025-04-01`;const COPILOT_INTEGRATION_ID=`vscode-chat`;function buildCopilotIdeHeaders(e={}){return{"Accept-Encoding":`identity`,"Editor-Version":COPILOT_EDITOR_VERSION,"Editor-Plugin-Version":COPILOT_EDITOR_PLUGIN_VERSION,"User-Agent":COPILOT_USER_AGENT,...e.includeApiVersion?{"X-Github-Api-Version":COPILOT_GITHUB_API_VERSION}:{}}}function hasCopilotVisionInput(e){return projectCopilotRequestFacts(e,`nested`).hasImages}function buildCopilotDynamicHeaders(e){return{"x-initiator":projectCopilotRequestFacts(e.messages,`nested`,e.hasImages).initiator,...e.hasImages?{"Copilot-Vision-Request":`true`}:{}}}export{COPILOT_USER_AGENT as a,hasCopilotVisionInput as c,COPILOT_INTEGRATION_ID as i,COPILOT_EDITOR_VERSION as n,buildCopilotDynamicHeaders as o,COPILOT_GITHUB_API_VERSION as r,buildCopilotIdeHeaders as s,COPILOT_EDITOR_PLUGIN_VERSION as t};