mirror of
https://github.com/openclaw/openclaw.git
synced 2026-08-27 21:07:01 -06:00
75dbe52e3e
* refactor(doctor): prefer manifest route-state owners * refactor(doctor): unify config repair declarations * refactor(doctor): unify legacy state migrations * fix(doctor): satisfy migration pipeline guards * fix(plugin-sdk): keep doctor adapter inside boundary
24 lines
1000 B
TypeScript
24 lines
1000 B
TypeScript
// Whatsapp plugin module implements channel.setup behavior.
|
|
import type { ChannelPlugin } from "openclaw/plugin-sdk/core";
|
|
import type { ResolvedWhatsAppAccount } from "./accounts.js";
|
|
import { readWhatsAppAccountLinkState } from "./channel-runtime-loader.js";
|
|
import {
|
|
resolveWhatsAppGroupRequireMention,
|
|
resolveWhatsAppGroupToolPolicy,
|
|
} from "./group-policy.js";
|
|
import { whatsappSetupContract } from "./setup-core.js";
|
|
import { createWhatsAppPluginBase, whatsappSetupWizardProxy } from "./shared.js";
|
|
|
|
export const whatsappSetupPlugin: ChannelPlugin<ResolvedWhatsAppAccount> = {
|
|
...createWhatsAppPluginBase({
|
|
groups: {
|
|
resolveRequireMention: resolveWhatsAppGroupRequireMention,
|
|
resolveToolPolicy: resolveWhatsAppGroupToolPolicy,
|
|
},
|
|
setupWizard: whatsappSetupWizardProxy,
|
|
setupContract: whatsappSetupContract,
|
|
isConfigured: (account) => Boolean(account.authDir),
|
|
isLinked: async (account) => await readWhatsAppAccountLinkState(account.authDir),
|
|
}),
|
|
};
|