Files
openclaw/src/plugin-sdk/whatsapp.ts
2026-03-18 04:29:50 +00:00

112 lines
3.7 KiB
TypeScript

export type { ChannelMessageActionName } from "../channels/plugins/types.js";
export type { OpenClawConfig } from "../config/config.js";
export type { DmPolicy, GroupPolicy, WhatsAppAccountConfig } from "../config/types.js";
export type { WebChannelStatus, WebMonitorTuning } from "../../extensions/whatsapp/runtime-api.js";
export type {
WebInboundMessage,
WebListenerCloseReason,
} from "../../extensions/whatsapp/runtime-api.js";
export type {
ChannelMessageActionContext,
ChannelPlugin,
OpenClawPluginApi,
PluginRuntime,
} from "./channel-plugin-common.js";
export {
DEFAULT_ACCOUNT_ID,
PAIRING_APPROVED_MESSAGE,
applyAccountNameToChannelSection,
buildChannelConfigSchema,
deleteAccountFromConfigSection,
emptyPluginConfigSchema,
formatPairingApproveHint,
getChatChannelMeta,
migrateBaseNameToDefaultAccount,
normalizeAccountId,
setAccountEnabledInConfigSection,
} from "./channel-plugin-common.js";
export { formatCliCommand } from "../cli/command-format.js";
export { formatDocsLink } from "../terminal/links.js";
export {
formatWhatsAppConfigAllowFromEntries,
resolveWhatsAppConfigAllowFrom,
resolveWhatsAppConfigDefaultTo,
} from "./channel-config-helpers.js";
export { normalizeWhatsAppAllowFromEntries } from "../channels/plugins/normalize/whatsapp.js";
export {
listWhatsAppDirectoryGroupsFromConfig,
listWhatsAppDirectoryPeersFromConfig,
} from "../../extensions/whatsapp/src/directory-config.js";
export {
collectAllowlistProviderGroupPolicyWarnings,
collectOpenGroupPolicyRouteAllowlistWarnings,
} from "../channels/plugins/group-policy-warnings.js";
export { buildAccountScopedDmSecurityPolicy } from "../channels/plugins/helpers.js";
export { resolveWhatsAppOutboundTarget } from "../whatsapp/resolve-outbound-target.js";
export { isWhatsAppGroupJid, normalizeWhatsAppTarget } from "../whatsapp/normalize.js";
export {
resolveAllowlistProviderRuntimeGroupPolicy,
resolveDefaultGroupPolicy,
} from "../config/runtime-group-policy.js";
export {
resolveWhatsAppGroupRequireMention,
resolveWhatsAppGroupToolPolicy,
} from "../../extensions/whatsapp/src/group-policy.js";
export {
createWhatsAppOutboundBase,
resolveWhatsAppGroupIntroHint,
resolveWhatsAppMentionStripRegexes,
} from "../channels/plugins/whatsapp-shared.js";
export { resolveWhatsAppHeartbeatRecipients } from "../channels/plugins/whatsapp-heartbeat.js";
export { WhatsAppConfigSchema } from "../config/zod-schema.providers-whatsapp.js";
export { createActionGate, readStringParam } from "../agents/tools/common.js";
export { createPluginRuntimeStore } from "./runtime-store.js";
export { normalizeE164 } from "../utils.js";
export {
hasAnyWhatsAppAuth,
listEnabledWhatsAppAccounts,
resolveWhatsAppAccount,
} from "../../extensions/whatsapp/api.js";
export {
WA_WEB_AUTH_DIR,
logWebSelfId,
logoutWeb,
pickWebChannel,
webAuthExists,
} from "../../extensions/whatsapp/runtime-api.js";
export {
DEFAULT_WEB_MEDIA_BYTES,
HEARTBEAT_PROMPT,
HEARTBEAT_TOKEN,
monitorWebChannel,
resolveHeartbeatRecipients,
runWebHeartbeatOnce,
} from "../../extensions/whatsapp/runtime-api.js";
export {
extractMediaPlaceholder,
extractText,
monitorWebInbox,
} from "../../extensions/whatsapp/runtime-api.js";
export { loginWeb } from "../../extensions/whatsapp/runtime-api.js";
export {
getDefaultLocalRoots,
loadWebMedia,
loadWebMediaRaw,
optimizeImageToJpeg,
} from "../../extensions/whatsapp/runtime-api.js";
export {
sendMessageWhatsApp,
sendPollWhatsApp,
sendReactionWhatsApp,
} from "../../extensions/whatsapp/runtime-api.js";
export {
createWaSocket,
formatError,
getStatusCode,
waitForWaConnection,
} from "../../extensions/whatsapp/runtime-api.js";
export { createWhatsAppLoginTool } from "../../extensions/whatsapp/runtime-api.js";