refactor(plugins): drop unused web-channel send wrapper · openclaw/openclaw@7fcbfa6
vincentkoc
·
2026-06-19
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -327,14 +327,5 @@ vi.mock("../plugins/loader.js", async () => {
|
327 | 327 | loadOpenClawPlugins: () => getTestPluginRegistry(), |
328 | 328 | }; |
329 | 329 | }); |
330 | | -vi.mock("../plugins/runtime/runtime-web-channel-plugin.js", () => ({ |
331 | | -sendWebChannelMessage: (...args: unknown[]) => |
332 | | -(gatewayTestHoisted.sendWhatsAppMock as (...args: unknown[]) => unknown)(...args), |
333 | | -})); |
334 | | -vi.mock("/src/plugins/runtime/runtime-web-channel-plugin.js", () => ({ |
335 | | -sendWebChannelMessage: (...args: unknown[]) => |
336 | | -(gatewayTestHoisted.sendWhatsAppMock as (...args: unknown[]) => unknown)(...args), |
337 | | -})); |
338 | | - |
339 | 330 | process.env.OPENCLAW_SKIP_CHANNELS = "1"; |
340 | 331 | process.env.OPENCLAW_SKIP_CRON = "1"; |
| Original file line number | Diff line number | Diff line change |
|---|
|
1 | 1 | // Runtime web-channel plugin helpers expose web-channel tools through activated plugin runtimes. |
2 | | -import type { OpenClawConfig } from "../../config/types.openclaw.js"; |
3 | 2 | import { |
4 | 3 | getDefaultLocalRoots as getDefaultLocalRootsImpl, |
5 | 4 | loadWebMedia as loadWebMediaImpl, |
@@ -60,23 +59,6 @@ type WebChannelHeavyRuntimeModule = {
|
60 | 59 | runtime?: unknown, |
61 | 60 | accountId?: string, |
62 | 61 | ) => Promise<void>; |
63 | | -sendMessageWhatsApp: ( |
64 | | -to: string, |
65 | | -body: string, |
66 | | -options: { |
67 | | -verbose: boolean; |
68 | | -cfg?: OpenClawConfig; |
69 | | -mediaUrl?: string; |
70 | | -mediaAccess?: { |
71 | | -localRoots?: readonly string[]; |
72 | | -readFile?: (filePath: string) => Promise<Buffer>; |
73 | | -}; |
74 | | -mediaLocalRoots?: readonly string[]; |
75 | | -mediaReadFile?: (filePath: string) => Promise<Buffer>; |
76 | | -gifPlayback?: boolean; |
77 | | -accountId?: string; |
78 | | -}, |
79 | | -) => Promise<{ messageId: string; toJid: string }>; |
80 | 62 | monitorWebChannel: (...args: unknown[]) => Promise<unknown>; |
81 | 63 | monitorWebInbox: (...args: unknown[]) => Promise<unknown>; |
82 | 64 | startWebLoginWithQr: (...args: unknown[]) => Promise<unknown>; |
@@ -234,13 +216,6 @@ export function webAuthExists(
|
234 | 216 | return getLightExport("webAuthExists")(...args); |
235 | 217 | } |
236 | 218 | |
237 | | -/** Sends a web-channel message through the heavy runtime API. */ |
238 | | -export function sendWebChannelMessage( |
239 | | - ...args: Parameters<WebChannelHeavyRuntimeModule["sendMessageWhatsApp"]> |
240 | | -): ReturnType<WebChannelHeavyRuntimeModule["sendMessageWhatsApp"]> { |
241 | | -return loadWebChannelHeavyModule().then((loaded) => loaded.sendMessageWhatsApp(...args)); |
242 | | -} |
243 | | - |
244 | 219 | /** Formats a web-channel runtime error through the light runtime API. */ |
245 | 220 | export function formatError( |
246 | 221 | ...args: Parameters<WebChannelLightRuntimeModule["formatError"]> |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。