UNPKG

openclaw

Version:

Multi-channel AI gateway with extensible messaging integrations

129 lines (128 loc) • 4.54 kB
import { a as resolveDebugProxySettings } from "./env-Dhl2_42G.mjs"; //#region src/proxy-capture/coverage.ts const DEBUG_PROXY_COVERAGE_ENTRIES = [ { id: "provider-transport-fetch", label: "Provider HTTP transport", modulePath: "src/agents/provider-transport-fetch.ts", protocols: [ "http", "https", "sse" ], status: "captured", notes: "Central provider request path routes through explicit proxy overrides and records request/response payloads." }, { id: "discord-rest", label: "Discord REST monitor fetch", modulePath: "extensions/discord/src/monitor/rest-fetch.ts", protocols: ["http", "https"], status: "captured", notes: "Discord monitor REST calls inherit the debug proxy and record HTTP exchanges." }, { id: "discord-gateway", label: "Discord gateway monitor", modulePath: "extensions/discord/src/monitor/gateway-plugin.ts", protocols: ["https", "wss"], status: "captured", notes: "Gateway metadata fetches and websocket lifecycle events are captured for monitor traffic." }, { id: "telegram-fetch", label: "Telegram fetch resolver", modulePath: "extensions/telegram/src/fetch.ts", protocols: ["http", "https"], status: "captured", notes: "Telegram API fetch fallback picks up debug proxy env and records outbound/inbound exchanges." }, { id: "mattermost-ws", label: "Mattermost monitor websocket", modulePath: "extensions/mattermost/src/mattermost/monitor-websocket.ts", protocols: ["ws", "wss"], status: "captured", notes: "Mattermost websocket monitor uses the debug proxy agent and records frame activity." }, { id: "openai-realtime-voice", label: "OpenAI realtime voice bridge", modulePath: "extensions/openai/realtime-voice-provider.ts", protocols: ["wss"], status: "captured", notes: "Realtime voice bridge now routes through the debug proxy agent and records websocket frames." }, { id: "openai-realtime-transcription", label: "OpenAI realtime transcription", modulePath: "extensions/openai/realtime-transcription-provider.ts", protocols: ["wss"], status: "captured", notes: "Realtime transcription sessions now route through the debug proxy agent and record websocket frames." }, { id: "openai-tts", label: "OpenAI text-to-speech", modulePath: "extensions/openai/speech-provider.ts", protocols: ["https"], status: "captured", notes: "Direct OpenAI TTS fetches record request/response payloads while inheriting proxy env routing." }, { id: "microsoft-voices", label: "Microsoft voice discovery", modulePath: "extensions/microsoft/speech-provider.ts", protocols: ["https"], status: "captured", notes: "Microsoft voice listing fetches record HTTP exchanges and follow process-wide proxy routing." }, { id: "feishu-client-http", label: "Feishu SDK HTTP client", modulePath: "extensions/feishu/src/client.ts", protocols: ["https"], status: "proxy-only", notes: "Feishu SDK traffic can inherit ambient proxying, but decrypted request/response capture is not yet wired at the SDK integration." }, { id: "feishu-client-ws", label: "Feishu SDK websocket client", modulePath: "extensions/feishu/src/client.ts", protocols: ["wss"], status: "proxy-only", notes: "Feishu websocket creation can inherit ambient proxying, but websocket frame capture is not yet wired." } ]; let warnedCoverageSessionKey = null; function buildDebugProxyCoverageReport() { const e = { captured: 0, "proxy-only": 0, uncovered: 0 }; for (const t of DEBUG_PROXY_COVERAGE_ENTRIES) e[t.status] += 1; return { summary: { total: DEBUG_PROXY_COVERAGE_ENTRIES.length, captured: e.captured, proxyOnly: e["proxy-only"], uncovered: e.uncovered }, entries: DEBUG_PROXY_COVERAGE_ENTRIES }; } function maybeWarnAboutDebugProxyCoverage(e = resolveDebugProxySettings(), t = (e) => console.warn(e)) { if (!e.enabled || !e.required) return; const n = `${e.sessionId}:${e.proxyUrl ?? ""}`; if (warnedCoverageSessionKey === n) return; warnedCoverageSessionKey = n; const r = buildDebugProxyCoverageReport(); const { summary: i } = r; const a = r.entries.filter((e) => e.status !== "captured"); if (a.length === 0) return; t(`[openclaw proxy] debug proxy coverage: ${i.captured}/${i.total} captured, ${i.proxyOnly} proxy-only, ${i.uncovered} uncovered.`); t(`[openclaw proxy] remaining gaps: ${a.map((e) => e.id).join(", ")}. Run \`openclaw proxy coverage\` for details.`); } //#endregion export { maybeWarnAboutDebugProxyCoverage as n, buildDebugProxyCoverageReport as t };