mirror of
https://github.com/openclaw/openclaw.git
synced 2026-04-08 15:51:06 +00:00
fix: restore whatsapp doctor contract surface
This commit is contained in:
11
extensions/whatsapp/src/doctor-contract.ts
Normal file
11
extensions/whatsapp/src/doctor-contract.ts
Normal file
@@ -0,0 +1,11 @@
|
||||
import type { ChannelDoctorConfigMutation } from "openclaw/plugin-sdk/channel-contract";
|
||||
import type { OpenClawConfig } from "openclaw/plugin-sdk/config-runtime";
|
||||
import { normalizeCompatibilityConfig as normalizeCompatibilityConfigImpl } from "./doctor.js";
|
||||
|
||||
export function normalizeCompatibilityConfig({
|
||||
cfg,
|
||||
}: {
|
||||
cfg: OpenClawConfig;
|
||||
}): ChannelDoctorConfigMutation {
|
||||
return normalizeCompatibilityConfigImpl({ cfg });
|
||||
}
|
||||
@@ -4,7 +4,11 @@ import type {
|
||||
} from "openclaw/plugin-sdk/channel-contract";
|
||||
import type { OpenClawConfig } from "openclaw/plugin-sdk/config-runtime";
|
||||
|
||||
function normalizeWhatsAppAckReactionConfig(cfg: OpenClawConfig): ChannelDoctorConfigMutation {
|
||||
export function normalizeCompatibilityConfig({
|
||||
cfg,
|
||||
}: {
|
||||
cfg: OpenClawConfig;
|
||||
}): ChannelDoctorConfigMutation {
|
||||
const legacyAckReaction = cfg.messages?.ackReaction?.trim();
|
||||
if (!legacyAckReaction || cfg.channels?.whatsapp === undefined) {
|
||||
return { config: cfg, changes: [] };
|
||||
@@ -48,5 +52,5 @@ function normalizeWhatsAppAckReactionConfig(cfg: OpenClawConfig): ChannelDoctorC
|
||||
}
|
||||
|
||||
export const whatsappDoctor: ChannelDoctorAdapter = {
|
||||
normalizeCompatibilityConfig: ({ cfg }) => normalizeWhatsAppAckReactionConfig(cfg),
|
||||
normalizeCompatibilityConfig,
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user