@openclaw/whatsapp 2026.9.9 → 2026.9.34

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -6,7 +6,7 @@ import { c as normalizeWhatsAppPayloadTextPreservingIndentation, i as sendTyping
6
6
  import { i as getWhatsAppRuntime } from "./runtime-BLlToOi6.mjs";
7
7
  import { c as toWhatsappJid } from "./targets-runtime-DmiqXIXO.mjs";
8
8
  import { c as getWhatsAppApprovalApprovers, l as whatsappApprovalAuth, s as lookupInboundMessageMetaForTarget, t as resolveWhatsAppGroupSessionKey } from "./group-session-key-2-mja4OF.mjs";
9
- import { a as loadWhatsAppChannelRuntime, t as createWhatsAppPluginBase } from "./shared-DgOG5Iqr.mjs";
9
+ import { a as loadWhatsAppChannelRuntime, t as createWhatsAppPluginBase } from "./shared-DhwI2lJs.mjs";
10
10
  import { t as whatsappCommandPolicy } from "./command-policy-BIOSHySD.mjs";
11
11
  import { f as readWebAuthExistsForDecision, n as WHATSAPP_AUTH_UNSTABLE_CODE } from "./auth-store-BBonwKks.mjs";
12
12
  import { createActionGate } from "openclaw/plugin-sdk/channel-actions";
@@ -1,9 +1,9 @@
1
1
  import { startWebLoginWithQr as startWebLoginWithQr$1, waitForWebLogin as waitForWebLogin$1 } from "../login-qr-runtime.js";
2
2
  import { c as logoutWeb, d as readWebAuthExistsBestEffort, f as readWebAuthExistsForDecision, g as readWebSelfId, h as readWebAuthState, m as readWebAuthSnapshotBestEffort, o as getWebAuthAgeMs, p as readWebAuthSnapshot, s as logWebSelfId, x as webAuthExists } from "./auth-store-BBonwKks.mjs";
3
3
  import { t as getActiveWebListener } from "./active-listener-CDjoX9QR.mjs";
4
- import { t as monitorWebChannel } from "./monitor-CGpV2VNN.mjs";
4
+ import { t as monitorWebChannel } from "./monitor-uxKyC0Pv.mjs";
5
5
  import { t as loginWeb } from "./login-BFlvSh9h.mjs";
6
- import { whatsappSetupWizard as whatsappSetupWizard$1 } from "./setup-surface-43fj197P.mjs";
6
+ import { whatsappSetupWizard as whatsappSetupWizard$1 } from "./setup-surface-mm1vo78D.mjs";
7
7
  //#region extensions/whatsapp/src/channel.runtime.ts
8
8
  async function startWebLoginWithQr(...args) {
9
9
  return await startWebLoginWithQr$1(...args);
@@ -1,4 +1,4 @@
1
- import { t as createWhatsAppPluginBase } from "./shared-DgOG5Iqr.mjs";
1
+ import { t as createWhatsAppPluginBase } from "./shared-DhwI2lJs.mjs";
2
2
  //#region extensions/whatsapp/src/channel.setup.ts
3
3
  const whatsappSetupPlugin = { ...createWhatsAppPluginBase() };
4
4
  //#endregion
@@ -0,0 +1 @@
1
+ export { whatsappLegacySessionSurface } from "../legacy-session-surface-api.js";
@@ -29,7 +29,7 @@ import { getAgentScopedMediaLocalRoots } from "openclaw/plugin-sdk/media-runtime
29
29
  import { isReasoningReplyPayload, resolveSendableOutboundReplyParts, resolveTextChunksWithFallback, sendMediaWithLeadingCaption } from "openclaw/plugin-sdk/reply-payload";
30
30
  import { normalizeE164, normalizeE164 as normalizeE164$1, normalizeE164 as normalizeE164$2, truncateUtf16Safe } from "openclaw/plugin-sdk/text-utility-runtime";
31
31
  import { createLazyRuntimeModule } from "openclaw/plugin-sdk/lazy-runtime";
32
- import { DisconnectReason, downloadMediaMessage, isHostedLidUser, isHostedPnUser, isJidGroup, isJidGroup as isJidGroup$1, jidDecode, jidEncode, jidNormalizedUser, normalizeMessageContent as normalizeMessageContent$1 } from "baileys";
32
+ import { DisconnectReason, WAMessageStubType, downloadMediaMessage, isHostedLidUser, isHostedPnUser, isJidGroup, isJidGroup as isJidGroup$1, jidDecode, jidEncode, jidNormalizedUser, normalizeMessageContent as normalizeMessageContent$1 } from "baileys";
33
33
  import { DEFAULT_ACCOUNT_ID, DEFAULT_MAIN_KEY, buildAgentMainSessionKey, buildAgentSessionKey, buildGroupHistoryKey, deriveLastRoutePolicy, normalizeAccountId, resolveAgentRoute, resolveInboundLastRouteSessionKey } from "openclaw/plugin-sdk/routing";
34
34
  import { asDateTimestampMs, parseStrictFiniteNumber, resolveExpiresAtMsFromDurationMs, resolvePromptHistoryLimit } from "openclaw/plugin-sdk/number-runtime";
35
35
  import { filterSupplementalContextItems, resolvePinnedMainDmOwnerFromAllowlist } from "openclaw/plugin-sdk/security-runtime";
@@ -737,13 +737,16 @@ function createWhatsAppInboundMessageDebouncer(options) {
737
737
  }
738
738
  //#endregion
739
739
  //#region extensions/whatsapp/src/inbound/media.ts
740
+ const NON_MEDIA_URL_HOSTS = /* @__PURE__ */ new Set(["a.whatsapp.net", "web.whatsapp.net"]);
740
741
  async function downloadInboundMedia(msg, sock, maxBytes = 52428800, normalizedMessage) {
741
742
  const message = normalizedMessage ?? normalizeMessageContent$1(msg.message);
742
743
  if (!message) return;
743
744
  const mimetype = resolveInboundMediaMimetype(message);
744
745
  const fileName = message.documentMessage?.fileName ?? void 0;
745
- if (!message.imageMessage && !message.videoMessage && !message.ptvMessage && !message.documentMessage && !message.audioMessage && !message.stickerMessage) return;
746
- const stream = await downloadMediaMessage(msg, "stream", {}, {
746
+ const media = message.imageMessage ?? message.videoMessage ?? message.ptvMessage ?? message.documentMessage ?? message.audioMessage ?? message.stickerMessage;
747
+ if (!media) return;
748
+ const urlHost = media.url ? URL.parse(media.url)?.hostname : void 0;
749
+ const stream = await downloadMediaMessage(msg, "stream", urlHost && NON_MEDIA_URL_HOSTS.has(urlHost) ? { host: sock.getMediaHost() } : {}, {
747
750
  reuploadRequest: sock.updateMediaMessage,
748
751
  logger: sock.logger
749
752
  });
@@ -1395,6 +1398,7 @@ function createWhatsAppMessageDeliveryCoordinator(options) {
1395
1398
  const handleMessagesUpsert = async (upsert) => {
1396
1399
  if (upsert.type !== "notify" && upsert.type !== "append") return;
1397
1400
  for (const msg of upsert.messages ?? []) {
1401
+ if (!msg.message && msg.messageStubType === WAMessageStubType.CIPHERTEXT) continue;
1398
1402
  rememberBaileysMessage(msg.key?.remoteJid, msg.key?.id, msg.message);
1399
1403
  const receiveOrder = nextReceiveOrder++;
1400
1404
  let approvalReactionResolved = false;
@@ -4155,7 +4159,7 @@ function createWebOnMessageHandler(params) {
4155
4159
  function isNonRetryableWebCloseStatus(statusCode) {
4156
4160
  return statusCode === 440;
4157
4161
  }
4158
- const loadReplyResolverRuntime = createLazyRuntimeModule(() => import("./reply-resolver.runtime-Ded8D58Y.mjs"));
4162
+ const loadReplyResolverRuntime = createLazyRuntimeModule(() => import("./reply-resolver.runtime-Byxo9w3l.mjs"));
4159
4163
  function resolveWebMonitorConfigSnapshot(params) {
4160
4164
  const account = resolveWhatsAppAccount({
4161
4165
  cfg: params.cfg,
@@ -0,0 +1 @@
1
+ export { getReplyFromConfig } from "openclaw/plugin-sdk/reply-runtime";
@@ -2,7 +2,7 @@ import { a as resolveWhatsAppAccount, o as resolveWhatsAppAuthDir } from "./acco
2
2
  import { r as resolveDefaultWhatsAppAccountId } from "./account-ids-CB5SOWjc.mjs";
3
3
  import { r as hasWebCredsSync } from "./creds-files-CDATZWWM.mjs";
4
4
  import { a as normalizeWhatsAppAllowFromEntries, o as normalizeWhatsAppAllowFromEntry } from "./normalize-target-BGra1ZnM.mjs";
5
- import { n as whatsappSetupAdapter } from "./shared-DgOG5Iqr.mjs";
5
+ import { n as whatsappSetupAdapter } from "./shared-DhwI2lJs.mjs";
6
6
  import { formatCliCommand, formatDocsLink } from "openclaw/plugin-sdk/setup-tools";
7
7
  import { DEFAULT_ACCOUNT_ID, createSetupTranslator, splitSetupEntries } from "openclaw/plugin-sdk/setup";
8
8
  //#region extensions/whatsapp/src/setup-finalize.ts
@@ -0,0 +1,2 @@
1
+ export { t as whatsappSetupPlugin } from "./channel.setup-BWAq5U-l.mjs";
2
+ import "../setup-plugin-api.js";
@@ -36,7 +36,7 @@ const whatsappSetupWizard = {
36
36
  },
37
37
  resolveShouldPromptAccountIds: ({ shouldPromptAccountIds }) => shouldPromptAccountIds,
38
38
  credentials: [],
39
- finalize: async (params) => await (await import("./setup-finalize-DmPX4EaW.mjs")).finalizeWhatsAppSetup(params),
39
+ finalize: async (params) => await (await import("./setup-finalize-tSzAh1Dh.mjs")).finalizeWhatsAppSetup(params),
40
40
  disable: (cfg) => setSetupChannelEnabled(cfg, channel, false),
41
41
  onAccountRecorded: (accountId, options) => {
42
42
  options?.onAccountId?.(channel, accountId);
@@ -27,7 +27,7 @@ async function readWhatsAppAccountLinkState(authDir) {
27
27
  }
28
28
  const loadWhatsAppChannelRuntime = createLazyRuntimeModule(async () => {
29
29
  await loadWhatsAppAuthStore();
30
- return await import("./channel.runtime-C94goLw9.mjs");
30
+ return await import("./channel.runtime-IIxWCkO4.mjs");
31
31
  });
32
32
  //#endregion
33
33
  //#region extensions/whatsapp/src/group-policy.ts
@@ -131,7 +131,7 @@ const whatsappResolveDmPolicy = createScopedDmSecurityResolver({
131
131
  });
132
132
  const whatsappSetupWizardProxy = createDelegatedSetupWizardProxy({
133
133
  channel: WHATSAPP_CHANNEL,
134
- loadWizard: async () => (await import("./setup-surface-43fj197P.mjs")).whatsappSetupWizard,
134
+ loadWizard: async () => (await import("./setup-surface-mm1vo78D.mjs")).whatsappSetupWizard,
135
135
  status: {
136
136
  configuredLabel: "linked",
137
137
  unconfiguredLabel: "not linked",
@@ -1,2 +1 @@
1
- import { t as handleWhatsAppAction } from "./.setup/action-runtime-DeVk5V7r.mjs";
2
- export { handleWhatsAppAction };
1
+ export { t as handleWhatsAppAction } from "./.setup/action-runtime-DeVk5V7r.mjs";
@@ -1,2 +1 @@
1
- import { t as handleWhatsAppAction } from "./.setup/action-runtime-DeVk5V7r.mjs";
2
- export { handleWhatsAppAction };
1
+ export { t as handleWhatsAppAction } from "./.setup/action-runtime-DeVk5V7r.mjs";
package/dist/api.js CHANGED
@@ -3,10 +3,10 @@ import { r as resolveDefaultWhatsAppAccountId, t as listAccountIds } from "./.se
3
3
  import { a as normalizeWhatsAppAllowFromEntries, c as normalizeWhatsAppTarget, i as looksLikeWhatsAppTargetId, r as isWhatsAppUserTarget, s as normalizeWhatsAppMessagingTarget, t as isWhatsAppGroupJid } from "./.setup/normalize-target-BGra1ZnM.mjs";
4
4
  import { t as resolveWhatsAppOutboundTarget } from "./.setup/resolve-outbound-target-C2eUvsTc.mjs";
5
5
  import { c as toWhatsappJid, i as markdownToWhatsApp, l as toWhatsappJidWithLid, n as isSelfChatMode, r as jidToE164, s as resolveJidToE164, t as assertWebChannel } from "./.setup/targets-runtime-DmiqXIXO.mjs";
6
- import { n as WHATSAPP_LEGACY_OUTBOUND_SEND_DEP_KEYS, t as whatsappPlugin } from "./.setup/channel-CJFE0kD_.mjs";
7
- import { i as resolveWhatsAppGroupToolPolicy, r as resolveWhatsAppGroupRequireMention } from "./.setup/shared-DgOG5Iqr.mjs";
6
+ import { n as WHATSAPP_LEGACY_OUTBOUND_SEND_DEP_KEYS, t as whatsappPlugin } from "./.setup/channel-DqZt_33q.mjs";
7
+ import { i as resolveWhatsAppGroupToolPolicy, r as resolveWhatsAppGroupRequireMention } from "./.setup/shared-DhwI2lJs.mjs";
8
8
  import { t as whatsappCommandPolicy } from "./.setup/command-policy-BIOSHySD.mjs";
9
- import { t as whatsappSetupPlugin } from "./.setup/channel.setup-CfN1UfdY.mjs";
9
+ import { t as whatsappSetupPlugin } from "./.setup/channel.setup-BWAq5U-l.mjs";
10
10
  import { t as DEFAULT_WEB_MEDIA_BYTES } from "./.setup/constants-C7m81BNe.mjs";
11
11
  import { d as DEFAULT_WHATSAPP_SOCKET_TIMING, f as createWhatsAppSocketOperationTimeoutAdapter, i as waitForWaConnection, r as createWaSocket } from "./.setup/socket-close-CT__V2fz.mjs";
12
12
  import { n as getStatusCode, t as formatError } from "./.setup/session-errors-B8UcAnZN.mjs";
@@ -1,2 +1 @@
1
- import { t as WhatsAppChannelConfigSchema } from "./.setup/config-schema-BYA6e_Ii.mjs";
2
- export { WhatsAppChannelConfigSchema };
1
+ export { t as WhatsAppChannelConfigSchema } from "./.setup/config-schema-BYA6e_Ii.mjs";
@@ -1,2 +1 @@
1
- import { t as whatsappPlugin } from "./.setup/channel-CJFE0kD_.mjs";
2
- export { whatsappPlugin };
1
+ export { t as whatsappPlugin } from "./.setup/channel-DqZt_33q.mjs";
@@ -1,2 +1 @@
1
- import { startWebLoginWithQr, waitForWebLogin } from "./login-qr-runtime.js";
2
- export { startWebLoginWithQr, waitForWebLogin };
1
+ export { startWebLoginWithQr, waitForWebLogin } from "./login-qr-runtime.js";
@@ -10,7 +10,7 @@ import { n as resolveWebAccountId, t as getActiveWebListener } from "./.setup/ac
10
10
  import { i as waitForWaConnection, r as createWaSocket, s as newConnectionId } from "./.setup/socket-close-CT__V2fz.mjs";
11
11
  import { n as getStatusCode, t as formatError } from "./.setup/session-errors-B8UcAnZN.mjs";
12
12
  import { p as extractText, s as extractContactContext, u as extractLocationData } from "./.setup/send-api-H4AkQJjT.mjs";
13
- import { a as loadWebMediaRaw, c as monitorWebInbox, i as loadWebMedia, l as resetWebInboundDedupe, n as LocalMediaAccessError, o as optimizeImageToJpeg, r as getDefaultLocalRoots, s as optimizeImageToPng, t as monitorWebChannel } from "./.setup/monitor-CGpV2VNN.mjs";
13
+ import { a as loadWebMediaRaw, c as monitorWebInbox, i as loadWebMedia, l as resetWebInboundDedupe, n as LocalMediaAccessError, o as optimizeImageToJpeg, r as getDefaultLocalRoots, s as optimizeImageToPng, t as monitorWebChannel } from "./.setup/monitor-uxKyC0Pv.mjs";
14
14
  import { t as loginWeb } from "./.setup/login-BFlvSh9h.mjs";
15
15
  import { HEARTBEAT_PROMPT, HEARTBEAT_TOKEN, SILENT_REPLY_TOKEN, stripHeartbeatToken } from "openclaw/plugin-sdk/reply-runtime";
16
16
  export { DEFAULT_WEB_MEDIA_BYTES, HEARTBEAT_PROMPT, HEARTBEAT_TOKEN, LocalMediaAccessError, SILENT_REPLY_TOKEN, WA_WEB_AUTH_DIR, WHATSAPP_AUTH_UNSTABLE_CODE, WhatsAppAuthUnstableError, createWaSocket, createWhatsAppLoginTool, extractContactContext, extractLocationData, extractText, formatError, formatWhatsAppWebAuthStatusState, getActiveWebListener, getDefaultLocalRoots, getStatusCode, getWebAuthAgeMs, handleWhatsAppAction, hasWebCredsSync, loadWebMedia, loadWebMediaRaw, logWebSelfId, loginWeb, logoutWeb, monitorWebChannel, monitorWebInbox, newConnectionId, optimizeImageToJpeg, optimizeImageToPng, pickWebChannel, readCredsJsonRaw, readWebAuthExistsBestEffort, readWebAuthExistsForDecision, readWebAuthSnapshot, readWebAuthSnapshotBestEffort, readWebAuthState, readWebSelfId, readWebSelfIdentity, readWebSelfIdentityForDecision, resetWebInboundDedupe, resolveDefaultWebAuthDir, resolveWebAccountId, resolveWebCredsBackupPath, resolveWebCredsPath, restoreCredsFromBackupIfNeeded, sendMessageWhatsApp, sendPollWhatsApp, sendReactionWhatsApp, sendTypingWhatsApp, setWhatsAppRuntime, startWebLoginWithQr, stripHeartbeatToken, waitForCredsSaveQueue, waitForCredsSaveQueueWithTimeout, waitForWaConnection, waitForWebLogin, webAuthExists, whatsAppActionRuntime, writeCredsJsonAtomically };
@@ -1,2 +1 @@
1
- import { a as setWhatsAppRuntime } from "./.setup/runtime-BLlToOi6.mjs";
2
- export { setWhatsAppRuntime };
1
+ export { a as setWhatsAppRuntime } from "./.setup/runtime-BLlToOi6.mjs";
@@ -1,2 +1 @@
1
- import { n as unsupportedSecretRefSurfacePatterns, t as collectUnsupportedSecretRefConfigCandidates } from "./.setup/security-contract-nAzD945y.mjs";
2
- export { collectUnsupportedSecretRefConfigCandidates, unsupportedSecretRefSurfacePatterns };
1
+ export { t as collectUnsupportedSecretRefConfigCandidates, n as unsupportedSecretRefSurfacePatterns } from "./.setup/security-contract-nAzD945y.mjs";
@@ -5,11 +5,11 @@ var setup_entry_default = defineBundledChannelSetupEntry({
5
5
  importMetaUrl: import.meta.url,
6
6
  features: { legacySessionSurfaces: true },
7
7
  plugin: {
8
- specifier: fileURLToPath(new URL(".setup/setup-plugin-api-vJlxKzca.mjs", import.meta.url).href),
8
+ specifier: fileURLToPath(new URL(".setup/setup-plugin-api-C73Mbd4f.mjs", import.meta.url).href),
9
9
  exportName: "whatsappSetupPlugin"
10
10
  },
11
11
  legacySessionSurface: {
12
- specifier: fileURLToPath(new URL(".setup/legacy-session-surface-api-B2szjq4r.mjs", import.meta.url).href),
12
+ specifier: fileURLToPath(new URL(".setup/legacy-session-surface-api-BwP_Pgmu.mjs", import.meta.url).href),
13
13
  exportName: "whatsappLegacySessionSurface"
14
14
  }
15
15
  });
@@ -1,2 +1 @@
1
- import { t as whatsappSetupPlugin } from "./.setup/channel.setup-CfN1UfdY.mjs";
2
- export { whatsappSetupPlugin };
1
+ export { t as whatsappSetupPlugin } from "./.setup/channel.setup-BWAq5U-l.mjs";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openclaw/whatsapp",
3
- "version": "2026.9.9",
3
+ "version": "2026.9.34",
4
4
  "description": "OpenClaw WhatsApp channel plugin for WhatsApp Web chats.",
5
5
  "repository": {
6
6
  "type": "git",
@@ -13,7 +13,7 @@
13
13
  "typebox": "1.3.34"
14
14
  },
15
15
  "peerDependencies": {
16
- "openclaw": ">=2026.9.9"
16
+ "openclaw": ">=2026.9.34"
17
17
  },
18
18
  "peerDependenciesMeta": {
19
19
  "openclaw": {
@@ -65,11 +65,11 @@
65
65
  "minHostVersion": ">=2026.4.25"
66
66
  },
67
67
  "compat": {
68
- "pluginApi": ">=2026.9.9"
68
+ "pluginApi": ">=2026.9.34"
69
69
  },
70
70
  "build": {
71
71
  "bundledDist": false,
72
- "openclawVersion": "2026.9.9"
72
+ "openclawVersion": "2026.9.34"
73
73
  },
74
74
  "release": {
75
75
  "publishToClawHub": true,
@@ -1,2 +0,0 @@
1
- import { whatsappLegacySessionSurface } from "../legacy-session-surface-api.js";
2
- export { whatsappLegacySessionSurface };
@@ -1,2 +0,0 @@
1
- import { getReplyFromConfig } from "openclaw/plugin-sdk/reply-runtime";
2
- export { getReplyFromConfig };
@@ -1,3 +0,0 @@
1
- import { t as whatsappSetupPlugin } from "./channel.setup-CfN1UfdY.mjs";
2
- import "../setup-plugin-api.js";
3
- export { whatsappSetupPlugin };