@openclaw/whatsapp 2026.5.6 → 2026.5.7-beta.1

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.
Files changed (32) hide show
  1. package/dist/{access-control-BQ3tCkH8.js → access-control-CTj7P7WP.js} +2 -2
  2. package/dist/{action-runtime-bsQE9CuK.js → action-runtime-BqYZmBX_.js} +1 -1
  3. package/dist/action-runtime-api.js +1 -1
  4. package/dist/action-runtime.runtime.js +1 -1
  5. package/dist/api.js +7 -7
  6. package/dist/{auth-store-BjCb50Ry.js → auth-store-BNZmNP-s.js} +2 -2
  7. package/dist/{channel-B17Hy8-W.js → channel-CTr3YjO8.js} +6 -6
  8. package/dist/channel-plugin-api.js +1 -1
  9. package/dist/{channel-react-action-B9eSz9-t.js → channel-react-action-BuSTzmDX.js} +1 -1
  10. package/dist/{channel.runtime-CXhHvkmj.js → channel.runtime-C3i9Svfj.js} +4 -4
  11. package/dist/{channel.setup-BeGeYs_M.js → channel.setup-BYtkDwHe.js} +2 -2
  12. package/dist/{connection-controller-BSdlKQ56.js → connection-controller-BCIuChXD.js} +1 -1
  13. package/dist/contract-api.js +1 -1
  14. package/dist/{identity-QHAlV7Fu.js → identity-DhaC0MoD.js} +1 -1
  15. package/dist/light-runtime-api.js +1 -1
  16. package/dist/{login-ytUQ-aQa.js → login-DSUTCcJ7.js} +2 -2
  17. package/dist/{login-qr-DO4oqAQx.js → login-qr-dfs8tfGo.js} +2 -2
  18. package/dist/login-qr-runtime.js +1 -1
  19. package/dist/{monitor-Ce7y4e_6.js → monitor-C5_C_RGJ.js} +114 -43
  20. package/dist/{outbound-adapter-CxwUJNMD.js → outbound-adapter-CbR17Ehj.js} +3 -3
  21. package/dist/{outbound-base-Bq1UYEK5.js → outbound-base-BmzhutvF.js} +3 -3
  22. package/dist/{outbound-media-contract-CGss_QHy.js → outbound-media-contract-BPdOq7Hb.js} +1 -1
  23. package/dist/outbound-payload-test-api.js +1 -1
  24. package/dist/{quoted-message-TENQzyxV.js → quoted-message-BXs55Teh.js} +1 -1
  25. package/dist/runtime-api.js +6 -6
  26. package/dist/{send-1CzaHJGH.js → send-CxctcFGT.js} +2 -2
  27. package/dist/setup-plugin-api.js +1 -1
  28. package/dist/{setup-surface-D3xANmE7.js → setup-surface-CF3l3gEZ.js} +2 -2
  29. package/dist/{shared-zLVJEVKz.js → shared-CTSTwprn.js} +2 -2
  30. package/dist/test-api.js +1 -1
  31. package/dist/{text-runtime-C1zNiZeO.js → text-runtime-DFFwk5z6.js} +28 -2
  32. package/package.json +4 -4
@@ -1,6 +1,6 @@
1
1
  import { a as resolveWhatsAppAccount } from "./accounts-BDqgpFEB.js";
2
- import { r as isSelfChatMode, t as text_runtime_exports } from "./text-runtime-C1zNiZeO.js";
3
- import { a as getSelfIdentity, o as getSenderIdentity } from "./identity-QHAlV7Fu.js";
2
+ import { r as isSelfChatMode, t as text_runtime_exports } from "./text-runtime-DFFwk5z6.js";
3
+ import { a as getSelfIdentity, o as getSenderIdentity } from "./identity-DhaC0MoD.js";
4
4
  import { t as resolveWhatsAppRuntimeGroupPolicy } from "./runtime-group-policy-Gp1lQ0at.js";
5
5
  import { defaultRuntime } from "openclaw/plugin-sdk/runtime-env";
6
6
  import { resolveChannelGroupPolicy, resolveChannelGroupRequireMention } from "openclaw/plugin-sdk/channel-policy";
@@ -1,7 +1,7 @@
1
1
  import { a as resolveWhatsAppAccount } from "./accounts-BDqgpFEB.js";
2
2
  import { t as resolveWhatsAppOutboundTarget } from "./resolve-outbound-target-CQ3Y1i0g.js";
3
3
  import { t as resolveWhatsAppReactionLevel } from "./reaction-level-CRVEVAfi.js";
4
- import { r as sendReactionWhatsApp } from "./send-1CzaHJGH.js";
4
+ import { r as sendReactionWhatsApp } from "./send-CxctcFGT.js";
5
5
  import { ToolAuthorizationError, createActionGate, jsonResult, readReactionParams, readStringParam } from "openclaw/plugin-sdk/channel-actions";
6
6
  //#region extensions/whatsapp/src/action-runtime-target-auth.ts
7
7
  function resolveAuthorizedWhatsAppOutboundTarget(params) {
@@ -1,2 +1,2 @@
1
- import { t as handleWhatsAppAction } from "./action-runtime-bsQE9CuK.js";
1
+ import { t as handleWhatsAppAction } from "./action-runtime-BqYZmBX_.js";
2
2
  export { handleWhatsAppAction };
@@ -1,2 +1,2 @@
1
- import { t as handleWhatsAppAction } from "./action-runtime-bsQE9CuK.js";
1
+ import { t as handleWhatsAppAction } from "./action-runtime-BqYZmBX_.js";
2
2
  export { handleWhatsAppAction };
package/dist/api.js CHANGED
@@ -3,17 +3,17 @@ import { a as resolveWhatsAppAccount, i as listWhatsAppAuthDirs, n as hasAnyWhat
3
3
  import { a as normalizeWhatsAppAllowFromEntries, c as normalizeWhatsAppTarget, i as looksLikeWhatsAppTargetId, r as isWhatsAppUserTarget, s as normalizeWhatsAppMessagingTarget, t as isWhatsAppGroupJid } from "./normalize-target-nXxC_hxG.js";
4
4
  import { t as resolveWhatsAppOutboundTarget } from "./resolve-outbound-target-CQ3Y1i0g.js";
5
5
  import "./reaction-level-CRVEVAfi.js";
6
- import { a as markdownToWhatsApp, i as jidToE164, n as assertWebChannel, o as resolveJidToE164, r as isSelfChatMode, s as toWhatsappJid, t as text_runtime_exports } from "./text-runtime-C1zNiZeO.js";
7
- import "./send-1CzaHJGH.js";
8
- import { t as whatsappPlugin } from "./channel-B17Hy8-W.js";
9
- import { n as WHATSAPP_LEGACY_OUTBOUND_SEND_DEP_KEYS } from "./outbound-base-Bq1UYEK5.js";
6
+ import { a as markdownToWhatsApp, i as jidToE164, n as assertWebChannel, o as resolveJidToE164, r as isSelfChatMode, s as toWhatsappJid, t as text_runtime_exports } from "./text-runtime-DFFwk5z6.js";
7
+ import "./send-CxctcFGT.js";
8
+ import { t as whatsappPlugin } from "./channel-CTr3YjO8.js";
9
+ import { n as WHATSAPP_LEGACY_OUTBOUND_SEND_DEP_KEYS } from "./outbound-base-BmzhutvF.js";
10
10
  import { t as whatsappCommandPolicy } from "./command-policy-O8sRnqUV.js";
11
- import { a as resolveWhatsAppGroupToolPolicy, i as resolveWhatsAppGroupRequireMention, o as resolveWhatsAppGroupIntroHint } from "./shared-zLVJEVKz.js";
11
+ import { a as resolveWhatsAppGroupToolPolicy, i as resolveWhatsAppGroupRequireMention, o as resolveWhatsAppGroupIntroHint } from "./shared-CTSTwprn.js";
12
12
  import "./config-schema-Dmo66Ubb.js";
13
- import { t as whatsappSetupPlugin } from "./channel.setup-BeGeYs_M.js";
13
+ import { t as whatsappSetupPlugin } from "./channel.setup-BYtkDwHe.js";
14
14
  import { t as DEFAULT_WEB_MEDIA_BYTES } from "./constants-DLGCIbfl.js";
15
15
  import { n as listWhatsAppDirectoryGroupsFromConfig, r as listWhatsAppDirectoryPeersFromConfig } from "./directory-config-BNCbgnmy.js";
16
- import { t as __testing } from "./access-control-BQ3tCkH8.js";
16
+ import { t as __testing } from "./access-control-CTj7P7WP.js";
17
17
  import "openclaw/plugin-sdk/channel-actions";
18
18
  import "openclaw/plugin-sdk/account-resolution";
19
19
  import "openclaw/plugin-sdk/core";
@@ -1,6 +1,6 @@
1
1
  import { n as resolveWebCredsBackupPath, r as resolveWebCredsPath } from "./creds-files-_2V8jzQa.js";
2
- import { t as text_runtime_exports } from "./text-runtime-C1zNiZeO.js";
3
- import { c as resolveComparableIdentity } from "./identity-QHAlV7Fu.js";
2
+ import { t as text_runtime_exports } from "./text-runtime-DFFwk5z6.js";
3
+ import { c as resolveComparableIdentity } from "./identity-DhaC0MoD.js";
4
4
  import fs from "node:fs";
5
5
  import path from "node:path";
6
6
  import { resolveOAuthDir as resolveOAuthDir$1 } from "openclaw/plugin-sdk/state-paths";
@@ -4,14 +4,14 @@ import { c as normalizeWhatsAppTarget, i as looksLikeWhatsAppTargetId, n as isWh
4
4
  import { t as resolveWhatsAppOutboundTarget } from "./resolve-outbound-target-CQ3Y1i0g.js";
5
5
  import { t as resolveWhatsAppReactionLevel } from "./reaction-level-CRVEVAfi.js";
6
6
  import "./normalize-Y3eBdM8a.js";
7
- import { r as normalizeWhatsAppPayloadTextPreservingIndentation } from "./outbound-media-contract-CGss_QHy.js";
8
- import { i as sendTypingWhatsApp, n as sendPollWhatsApp, t as sendMessageWhatsApp } from "./send-1CzaHJGH.js";
7
+ import { r as normalizeWhatsAppPayloadTextPreservingIndentation } from "./outbound-media-contract-BPdOq7Hb.js";
8
+ import { i as sendTypingWhatsApp, n as sendPollWhatsApp, t as sendMessageWhatsApp } from "./send-CxctcFGT.js";
9
9
  import { t as createWhatsAppLoginTool } from "./agent-tools-login-DpRxLNRB.js";
10
- import { t as createWhatsAppOutboundBase } from "./outbound-base-Bq1UYEK5.js";
10
+ import { t as createWhatsAppOutboundBase } from "./outbound-base-BmzhutvF.js";
11
11
  import { t as getWhatsAppRuntime } from "./runtime-6fZ67abR.js";
12
12
  import { t as whatsappCommandPolicy } from "./command-policy-O8sRnqUV.js";
13
- import { a as resolveWhatsAppGroupToolPolicy, c as formatWhatsAppConfigAllowFromEntries, i as resolveWhatsAppGroupRequireMention, n as loadWhatsAppChannelRuntime, o as resolveWhatsAppGroupIntroHint, r as whatsappSetupWizardProxy, s as resolveWhatsAppMentionStripRegexes, t as createWhatsAppPluginBase } from "./shared-zLVJEVKz.js";
14
- import { d as readWebAuthExistsForDecision, n as WHATSAPP_AUTH_UNSTABLE_CODE } from "./auth-store-BjCb50Ry.js";
13
+ import { a as resolveWhatsAppGroupToolPolicy, c as formatWhatsAppConfigAllowFromEntries, i as resolveWhatsAppGroupRequireMention, n as loadWhatsAppChannelRuntime, o as resolveWhatsAppGroupIntroHint, r as whatsappSetupWizardProxy, s as resolveWhatsAppMentionStripRegexes, t as createWhatsAppPluginBase } from "./shared-CTSTwprn.js";
14
+ import { d as readWebAuthExistsForDecision, n as WHATSAPP_AUTH_UNSTABLE_CODE } from "./auth-store-BNZmNP-s.js";
15
15
  import { t as whatsappSetupAdapter } from "./setup-core-DZKvpzbH.js";
16
16
  import { t as detectWhatsAppLegacyStateMigrations } from "./state-migrations-DnCdvoYD.js";
17
17
  import { createActionGate as createActionGate$1 } from "openclaw/plugin-sdk/channel-actions";
@@ -297,7 +297,7 @@ function collectWhatsAppStatusIssues(accounts) {
297
297
  //#endregion
298
298
  //#region extensions/whatsapp/src/channel.ts
299
299
  const loadWhatsAppDirectoryConfig = createLazyRuntimeModule(() => import("./directory-config-BNCbgnmy.js").then((n) => n.t));
300
- const loadWhatsAppChannelReactAction = createLazyRuntimeModule(() => import("./channel-react-action-B9eSz9-t.js"));
300
+ const loadWhatsAppChannelReactAction = createLazyRuntimeModule(() => import("./channel-react-action-BuSTzmDX.js"));
301
301
  function parseWhatsAppExplicitTarget(raw) {
302
302
  const normalized = normalizeWhatsAppTarget(raw);
303
303
  if (!normalized) return null;
@@ -1,2 +1,2 @@
1
- import { t as whatsappPlugin } from "./channel-B17Hy8-W.js";
1
+ import { t as whatsappPlugin } from "./channel-CTr3YjO8.js";
2
2
  export { whatsappPlugin };
@@ -1,5 +1,5 @@
1
1
  import { c as normalizeWhatsAppTarget, t as isWhatsAppGroupJid } from "./normalize-target-nXxC_hxG.js";
2
- import { t as handleWhatsAppAction } from "./action-runtime-bsQE9CuK.js";
2
+ import { t as handleWhatsAppAction } from "./action-runtime-BqYZmBX_.js";
3
3
  import "./normalize-Y3eBdM8a.js";
4
4
  import { readStringOrNumberParam, readStringParam as readStringParam$1, resolveReactionMessageId } from "openclaw/plugin-sdk/channel-actions";
5
5
  //#region extensions/whatsapp/src/channel-react-action.ts
@@ -1,9 +1,9 @@
1
1
  import { startWebLoginWithQr as startWebLoginWithQr$1, waitForWebLogin as waitForWebLogin$1 } from "./login-qr-runtime.js";
2
- import { a as getWebAuthAgeMs$1, b as webAuthExists$1, d as readWebAuthExistsForDecision$1, f as readWebAuthSnapshot$1, h as readWebSelfId$1, m as readWebAuthState$1, o as logWebSelfId$1, p as readWebAuthSnapshotBestEffort$1, s as logoutWeb$1, u as readWebAuthExistsBestEffort$1 } from "./auth-store-BjCb50Ry.js";
2
+ import { a as getWebAuthAgeMs$1, b as webAuthExists$1, d as readWebAuthExistsForDecision$1, f as readWebAuthSnapshot$1, h as readWebSelfId$1, m as readWebAuthState$1, o as logWebSelfId$1, p as readWebAuthSnapshotBestEffort$1, s as logoutWeb$1, u as readWebAuthExistsBestEffort$1 } from "./auth-store-BNZmNP-s.js";
3
3
  import { t as getActiveWebListener$1 } from "./active-listener-N7GFKsuN.js";
4
- import { t as monitorWebChannel$1 } from "./monitor-Ce7y4e_6.js";
5
- import { t as loginWeb$1 } from "./login-ytUQ-aQa.js";
6
- import { whatsappSetupWizard as whatsappSetupWizard$1 } from "./setup-surface-D3xANmE7.js";
4
+ import { t as monitorWebChannel$1 } from "./monitor-C5_C_RGJ.js";
5
+ import { t as loginWeb$1 } from "./login-DSUTCcJ7.js";
6
+ import { whatsappSetupWizard as whatsappSetupWizard$1 } from "./setup-surface-CF3l3gEZ.js";
7
7
  //#region extensions/whatsapp/src/channel.runtime.ts
8
8
  function getActiveWebListener(...args) {
9
9
  return getActiveWebListener$1(...args);
@@ -1,5 +1,5 @@
1
- import { a as resolveWhatsAppGroupToolPolicy, i as resolveWhatsAppGroupRequireMention, o as resolveWhatsAppGroupIntroHint, r as whatsappSetupWizardProxy, t as createWhatsAppPluginBase } from "./shared-zLVJEVKz.js";
2
- import { m as readWebAuthState } from "./auth-store-BjCb50Ry.js";
1
+ import { a as resolveWhatsAppGroupToolPolicy, i as resolveWhatsAppGroupRequireMention, o as resolveWhatsAppGroupIntroHint, r as whatsappSetupWizardProxy, t as createWhatsAppPluginBase } from "./shared-CTSTwprn.js";
2
+ import { m as readWebAuthState } from "./auth-store-BNZmNP-s.js";
3
3
  import { t as whatsappSetupAdapter } from "./setup-core-DZKvpzbH.js";
4
4
  import { t as detectWhatsAppLegacyStateMigrations } from "./state-migrations-DnCdvoYD.js";
5
5
  //#region extensions/whatsapp/src/channel.setup.ts
@@ -1,7 +1,7 @@
1
1
  import { n as resolveWebCredsBackupPath, r as resolveWebCredsPath } from "./creds-files-_2V8jzQa.js";
2
2
  import { n as registerWhatsAppConnectionController, r as unregisterWhatsAppConnectionController } from "./connection-controller-registry-D_iIGz5m.js";
3
3
  import { n as getStatusCode, t as formatError } from "./session-errors-CSuKZPub.js";
4
- import { C as waitForCredsSaveQueueWithTimeout, l as readCredsJsonRaw, s as logoutWeb, v as resolveDefaultWebAuthDir, w as writeCredsJsonAtomically, x as enqueueCredsSave, y as restoreCredsFromBackupIfNeeded } from "./auth-store-BjCb50Ry.js";
4
+ import { C as waitForCredsSaveQueueWithTimeout, l as readCredsJsonRaw, s as logoutWeb, v as resolveDefaultWebAuthDir, w as writeCredsJsonAtomically, x as enqueueCredsSave, y as restoreCredsFromBackupIfNeeded } from "./auth-store-BNZmNP-s.js";
5
5
  import { i as makeWASocket, n as fetchLatestBaileysVersion, o as useMultiFileAuthState, r as makeCacheableSignalKeyStore, t as DisconnectReason$1 } from "./session.runtime-C1eSE_KK.js";
6
6
  import fs from "node:fs";
7
7
  import { clamp, ensureDir, resolveUserPath } from "openclaw/plugin-sdk/text-runtime";
@@ -5,7 +5,7 @@ import { n as unsupportedSecretRefSurfacePatterns, t as collectUnsupportedSecret
5
5
  import { r as isLegacyGroupSessionKey$1, t as canonicalizeLegacySessionKey$1 } from "./session-contract-B0efQf9P.js";
6
6
  import { n as listWhatsAppDirectoryGroupsFromConfig, r as listWhatsAppDirectoryPeersFromConfig } from "./directory-config-BNCbgnmy.js";
7
7
  import { t as resolveWhatsAppRuntimeGroupPolicy$1 } from "./runtime-group-policy-Gp1lQ0at.js";
8
- import { t as __testing } from "./access-control-BQ3tCkH8.js";
8
+ import { t as __testing } from "./access-control-CTj7P7WP.js";
9
9
  //#region extensions/whatsapp/contract-api.ts
10
10
  const canonicalizeLegacySessionKey = canonicalizeLegacySessionKey$1;
11
11
  const isLegacyGroupSessionKey = isLegacyGroupSessionKey$1;
@@ -1,4 +1,4 @@
1
- import { i as jidToE164, t as text_runtime_exports } from "./text-runtime-C1zNiZeO.js";
1
+ import { i as jidToE164, t as text_runtime_exports } from "./text-runtime-DFFwk5z6.js";
2
2
  //#region extensions/whatsapp/src/identity.ts
3
3
  const WHATSAPP_LID_RE = /@(lid|hosted\.lid)$/i;
4
4
  function normalizeDeviceScopedJid(jid) {
@@ -1,5 +1,5 @@
1
1
  import { n as getStatusCode, t as formatError } from "./session-errors-CSuKZPub.js";
2
2
  import { t as createWhatsAppLoginTool } from "./agent-tools-login-DpRxLNRB.js";
3
- import { a as getWebAuthAgeMs, b as webAuthExists, c as pickWebChannel, h as readWebSelfId, o as logWebSelfId, s as logoutWeb, t as WA_WEB_AUTH_DIR } from "./auth-store-BjCb50Ry.js";
3
+ import { a as getWebAuthAgeMs, b as webAuthExists, c as pickWebChannel, h as readWebSelfId, o as logWebSelfId, s as logoutWeb, t as WA_WEB_AUTH_DIR } from "./auth-store-BNZmNP-s.js";
4
4
  import { t as getActiveWebListener } from "./active-listener-N7GFKsuN.js";
5
5
  export { WA_WEB_AUTH_DIR, createWhatsAppLoginTool, formatError, getActiveWebListener, getStatusCode, getWebAuthAgeMs, logWebSelfId, logoutWeb, pickWebChannel, readWebSelfId, webAuthExists };
@@ -1,7 +1,7 @@
1
1
  import { t as __exportAll } from "./rolldown-runtime-RkAeH_Qm.js";
2
2
  import { a as resolveWhatsAppAccount } from "./accounts-BDqgpFEB.js";
3
- import { y as restoreCredsFromBackupIfNeeded } from "./auth-store-BjCb50Ry.js";
4
- import { a as waitForWhatsAppLoginResult, i as closeWaSocketSoon, l as resolveWhatsAppSocketTiming, o as createWaSocket, u as renderQrTerminal } from "./connection-controller-BSdlKQ56.js";
3
+ import { y as restoreCredsFromBackupIfNeeded } from "./auth-store-BNZmNP-s.js";
4
+ import { a as waitForWhatsAppLoginResult, i as closeWaSocketSoon, l as resolveWhatsAppSocketTiming, o as createWaSocket, u as renderQrTerminal } from "./connection-controller-BCIuChXD.js";
5
5
  import { logInfo } from "openclaw/plugin-sdk/text-runtime";
6
6
  import { formatCliCommand } from "openclaw/plugin-sdk/cli-runtime";
7
7
  import { danger, defaultRuntime, success } from "openclaw/plugin-sdk/runtime-env";
@@ -1,6 +1,6 @@
1
1
  import { a as resolveWhatsAppAccount } from "./accounts-BDqgpFEB.js";
2
- import { d as readWebAuthExistsForDecision, h as readWebSelfId, n as WHATSAPP_AUTH_UNSTABLE_CODE } from "./auth-store-BjCb50Ry.js";
3
- import { a as waitForWhatsAppLoginResult, l as resolveWhatsAppSocketTiming, o as createWaSocket, r as closeWaSocket, t as WHATSAPP_LOGGED_OUT_QR_MESSAGE } from "./connection-controller-BSdlKQ56.js";
2
+ import { d as readWebAuthExistsForDecision, h as readWebSelfId, n as WHATSAPP_AUTH_UNSTABLE_CODE } from "./auth-store-BNZmNP-s.js";
3
+ import { a as waitForWhatsAppLoginResult, l as resolveWhatsAppSocketTiming, o as createWaSocket, r as closeWaSocket, t as WHATSAPP_LOGGED_OUT_QR_MESSAGE } from "./connection-controller-BCIuChXD.js";
4
4
  import { logInfo } from "openclaw/plugin-sdk/text-runtime";
5
5
  import { danger, defaultRuntime, info, success } from "openclaw/plugin-sdk/runtime-env";
6
6
  import { renderQrPngDataUrl } from "openclaw/plugin-sdk/media-runtime";
@@ -1,7 +1,7 @@
1
1
  //#region extensions/whatsapp/login-qr-runtime.ts
2
2
  let loginQrModulePromise = null;
3
3
  function loadLoginQrModule() {
4
- loginQrModulePromise ??= import("./login-qr-DO4oqAQx.js");
4
+ loginQrModulePromise ??= import("./login-qr-dfs8tfGo.js");
5
5
  return loginQrModulePromise;
6
6
  }
7
7
  async function startWebLoginWithQr(...args) {
@@ -3,14 +3,14 @@ import { n as isWhatsAppNewsletterJid, t as isWhatsAppGroupJid$1 } from "./norma
3
3
  import { t as resolveWhatsAppReactionLevel } from "./reaction-level-CRVEVAfi.js";
4
4
  import "./normalize-Y3eBdM8a.js";
5
5
  import { n as getStatusCode, t as formatError } from "./session-errors-CSuKZPub.js";
6
- import { a as markdownToWhatsApp, i as jidToE164, o as resolveJidToE164, r as isSelfChatMode, s as toWhatsappJid, t as text_runtime_exports } from "./text-runtime-C1zNiZeO.js";
7
- import { i as prepareWhatsAppOutboundMedia, o as sendWhatsAppOutboundWithRetry, r as normalizeWhatsAppPayloadTextPreservingIndentation, t as normalizeWhatsAppOutboundPayload } from "./outbound-media-contract-CGss_QHy.js";
8
- import { r as sendReactionWhatsApp } from "./send-1CzaHJGH.js";
9
- import { n as cacheInboundMessageMeta, r as lookupInboundMessageMeta, t as buildQuotedMessageOptions } from "./quoted-message-TENQzyxV.js";
10
- import { _ as readWebSelfIdentityForDecision, a as getWebAuthAgeMs, h as readWebSelfId, r as WhatsAppAuthUnstableError, s as logoutWeb } from "./auth-store-BjCb50Ry.js";
11
- import { a as getSelfIdentity, c as resolveComparableIdentity, i as getReplyContext, n as getMentionIdentities, o as getSenderIdentity, r as getPrimaryIdentityId, s as identitiesOverlap, t as getComparableIdentityValues } from "./identity-QHAlV7Fu.js";
12
- import { i as resolveWhatsAppInboundPolicy, n as checkInboundAccessControl, r as resolveWhatsAppCommandAuthorized } from "./access-control-BQ3tCkH8.js";
13
- import { c as waitForWaConnection, d as DEFAULT_RECONNECT_POLICY, f as computeBackoff, g as sleepWithAbort, h as resolveReconnectPolicy, l as resolveWhatsAppSocketTiming, m as resolveHeartbeatSeconds, n as WhatsAppConnectionController, o as createWaSocket, p as newConnectionId } from "./connection-controller-BSdlKQ56.js";
6
+ import { a as markdownToWhatsApp, c as toWhatsappJidWithLid, i as jidToE164, o as resolveJidToE164, r as isSelfChatMode, s as toWhatsappJid, t as text_runtime_exports } from "./text-runtime-DFFwk5z6.js";
7
+ import { i as prepareWhatsAppOutboundMedia, o as sendWhatsAppOutboundWithRetry, r as normalizeWhatsAppPayloadTextPreservingIndentation, t as normalizeWhatsAppOutboundPayload } from "./outbound-media-contract-BPdOq7Hb.js";
8
+ import { r as sendReactionWhatsApp } from "./send-CxctcFGT.js";
9
+ import { n as cacheInboundMessageMeta, r as lookupInboundMessageMeta, t as buildQuotedMessageOptions } from "./quoted-message-BXs55Teh.js";
10
+ import { _ as readWebSelfIdentityForDecision, a as getWebAuthAgeMs, h as readWebSelfId, r as WhatsAppAuthUnstableError, s as logoutWeb } from "./auth-store-BNZmNP-s.js";
11
+ import { a as getSelfIdentity, c as resolveComparableIdentity, i as getReplyContext, n as getMentionIdentities, o as getSenderIdentity, r as getPrimaryIdentityId, s as identitiesOverlap, t as getComparableIdentityValues } from "./identity-DhaC0MoD.js";
12
+ import { i as resolveWhatsAppInboundPolicy, n as checkInboundAccessControl, r as resolveWhatsAppCommandAuthorized } from "./access-control-CTj7P7WP.js";
13
+ import { c as waitForWaConnection, d as DEFAULT_RECONNECT_POLICY, f as computeBackoff, g as sleepWithAbort, h as resolveReconnectPolicy, l as resolveWhatsAppSocketTiming, m as resolveHeartbeatSeconds, n as WhatsAppConnectionController, o as createWaSocket, p as newConnectionId } from "./connection-controller-BCIuChXD.js";
14
14
  import { resolveAccountEntry } from "openclaw/plugin-sdk/account-core";
15
15
  import { getChildLogger, normalizeLowercaseStringOrEmpty } from "openclaw/plugin-sdk/text-runtime";
16
16
  import { createAckReactionHandle, logAckFailure, removeAckReactionHandleAfterReply, shouldAckReactionForWhatsApp } from "openclaw/plugin-sdk/channel-feedback";
@@ -774,6 +774,7 @@ function recordWhatsAppOutbound(accountId) {
774
774
  });
775
775
  }
776
776
  function createWebSendApi(params) {
777
+ const resolveOutboundJid = (recipient) => params.authDir ? toWhatsappJidWithLid(recipient, { authDir: params.authDir }) : toWhatsappJid(recipient);
777
778
  const resolveMentions = async (jid, text) => params.resolveOutboundMentions ? await params.resolveOutboundMentions({
778
779
  jid,
779
780
  text
@@ -783,7 +784,7 @@ function createWebSendApi(params) {
783
784
  };
784
785
  return {
785
786
  sendMessage: async (to, text, mediaBuffer, mediaType, sendOptions) => {
786
- const jid = toWhatsappJid(to);
787
+ const jid = resolveOutboundJid(to);
787
788
  let payload;
788
789
  if (mediaBuffer) mediaType ??= "application/octet-stream";
789
790
  const shouldSendAudioText = Boolean(mediaBuffer && mediaType?.startsWith("audio/") && text.trim());
@@ -835,7 +836,7 @@ function createWebSendApi(params) {
835
836
  return combineWhatsAppSendResults(mediaBuffer ? "media" : "text", results);
836
837
  },
837
838
  sendPoll: async (to, poll) => {
838
- const jid = toWhatsappJid(to);
839
+ const jid = resolveOutboundJid(to);
839
840
  const result = await params.sock.sendMessage(jid, { poll: {
840
841
  name: poll.question,
841
842
  values: poll.options,
@@ -857,7 +858,7 @@ function createWebSendApi(params) {
857
858
  } }), "reaction");
858
859
  },
859
860
  sendComposingTo: async (to) => {
860
- const jid = toWhatsappJid(to);
861
+ const jid = resolveOutboundJid(to);
861
862
  if (isWhatsAppNewsletterJid(jid)) return;
862
863
  await params.sock.sendPresenceUpdate("composing", jid);
863
864
  }
@@ -1392,7 +1393,8 @@ async function attachWebInboxToSocket(options) {
1392
1393
  }
1393
1394
  },
1394
1395
  defaultAccountId: options.accountId,
1395
- resolveOutboundMentions: ({ jid, text }) => resolveOutboundMentionsForGroup(jid, text)
1396
+ resolveOutboundMentions: ({ jid, text }) => resolveOutboundMentionsForGroup(jid, text),
1397
+ authDir: options.authDir
1396
1398
  })
1397
1399
  };
1398
1400
  }
@@ -2227,6 +2229,47 @@ function resolveWhatsAppDeliverablePayload(payload, info) {
2227
2229
  }
2228
2230
  return payload;
2229
2231
  }
2232
+ function getWhatsAppPayloadMediaUrls(payload) {
2233
+ return new Set([...Array.isArray(payload.mediaUrls) ? payload.mediaUrls : [], ...typeof payload.mediaUrl === "string" ? [payload.mediaUrl] : []].map((url) => url.trim()).filter(Boolean));
2234
+ }
2235
+ function hasWhatsAppMediaUrlOverlap(left, right) {
2236
+ for (const url of left) if (right.has(url)) return true;
2237
+ return false;
2238
+ }
2239
+ function shouldDeferWhatsAppMediaOnlyPayload(params) {
2240
+ return params.info.kind !== "final" && params.reply.hasMedia && !params.reply.text.trim() && params.mediaUrls.size > 0;
2241
+ }
2242
+ function createWhatsAppMediaOnlyReplyCoalescer(params) {
2243
+ const pendingMediaOnlyPayloads = [];
2244
+ const flushExceptDuplicateMedia = async (mediaUrls) => {
2245
+ const flushResult = {
2246
+ delivered: 0,
2247
+ droppedDuplicateMedia: 0
2248
+ };
2249
+ const pending = pendingMediaOnlyPayloads.splice(0);
2250
+ for (const candidate of pending) {
2251
+ if (mediaUrls && hasWhatsAppMediaUrlOverlap(candidate.mediaUrls, mediaUrls)) {
2252
+ flushResult.droppedDuplicateMedia += 1;
2253
+ continue;
2254
+ }
2255
+ await params.deliver(candidate);
2256
+ flushResult.delivered += 1;
2257
+ }
2258
+ return flushResult;
2259
+ };
2260
+ return {
2261
+ defer(pending) {
2262
+ pendingMediaOnlyPayloads.push(pending);
2263
+ },
2264
+ flushExceptDuplicateMedia,
2265
+ flushAll: () => flushExceptDuplicateMedia()
2266
+ };
2267
+ }
2268
+ function logWhatsAppMediaOnlyFlushResult(result) {
2269
+ if (!shouldLogVerbose$1()) return;
2270
+ if (result.droppedDuplicateMedia > 0) logVerbose$1(`Dropped ${result.droppedDuplicateMedia} deferred media-only WhatsApp reply payload(s) superseded by captioned media`);
2271
+ if (result.delivered > 0) logVerbose$1(`Flushed ${result.delivered} deferred media-only WhatsApp reply payload(s)`);
2272
+ }
2230
2273
  function resolveWhatsAppResponsePrefix(params) {
2231
2274
  const configuredResponsePrefix = params.cfg.messages?.responsePrefix;
2232
2275
  return params.pipelineResponsePrefix ?? (configuredResponsePrefix === void 0 && params.isSelfChat ? resolveIdentityNamePrefix$1(params.cfg, params.agentId) : void 0);
@@ -2328,6 +2371,46 @@ async function dispatchWhatsAppBufferedReply(params) {
2328
2371
  const disableBlockStreaming = sourceReplyDeliveryMode === "message_tool_only" ? true : resolveWhatsAppDisableBlockStreaming(params.cfg);
2329
2372
  let didSendReply = false;
2330
2373
  let didLogHeartbeatStrip = false;
2374
+ const deliverNormalizedPayload = async (normalizedDeliveryPayload, info) => {
2375
+ const reply = resolveSendableOutboundReplyParts(normalizedDeliveryPayload);
2376
+ if (!reply.hasMedia && !reply.text.trim()) return;
2377
+ if (!(await params.deliverReply({
2378
+ replyResult: normalizedDeliveryPayload,
2379
+ normalizedReplyResult: normalizedDeliveryPayload,
2380
+ msg: params.msg,
2381
+ mediaLocalRoots,
2382
+ maxMediaBytes: params.maxMediaBytes,
2383
+ textLimit,
2384
+ chunkMode,
2385
+ replyLogger: params.replyLogger,
2386
+ connectionId: params.connectionId,
2387
+ skipLog: false,
2388
+ tableMode
2389
+ })).providerAccepted) {
2390
+ params.replyLogger.warn({
2391
+ correlationId: params.msg.id ?? null,
2392
+ connectionId: params.connectionId,
2393
+ conversationId: params.conversationId,
2394
+ chatId: params.msg.chatId,
2395
+ to: params.msg.from,
2396
+ from: params.msg.to,
2397
+ replyKind: info.kind
2398
+ }, "auto-reply was not accepted by WhatsApp provider");
2399
+ return;
2400
+ }
2401
+ didSendReply = true;
2402
+ const shouldLog = normalizedDeliveryPayload.text ? true : void 0;
2403
+ params.rememberSentText(normalizedDeliveryPayload.text, {
2404
+ combinedBody: params.context.Body,
2405
+ combinedBodySessionKey: params.route.sessionKey,
2406
+ logVerboseMessage: shouldLog
2407
+ });
2408
+ const fromDisplay = params.msg.chatType === "group" ? params.conversationId : params.msg.from ?? "unknown";
2409
+ if (shouldLogVerbose$1()) logVerbose$1(`Reply body: ${normalizedDeliveryPayload.text != null ? reply.text : "<media>"}${reply.hasMedia ? " (media)" : ""} -> ${fromDisplay}`);
2410
+ };
2411
+ const mediaOnlyCoalescer = createWhatsAppMediaOnlyReplyCoalescer({ deliver: async (pending) => {
2412
+ await deliverNormalizedPayload(pending.payload, pending.info);
2413
+ } });
2331
2414
  const { queuedFinal, counts } = await dispatchReplyWithBufferedBlockDispatcher({
2332
2415
  ctx: params.context,
2333
2416
  cfg: params.cfg,
@@ -2350,39 +2433,26 @@ async function dispatchWhatsAppBufferedReply(params) {
2350
2433
  } : normalizedOutboundPayload;
2351
2434
  const reply = resolveSendableOutboundReplyParts(normalizedDeliveryPayload);
2352
2435
  if (!reply.hasMedia && !reply.text.trim()) return;
2353
- if (!(await params.deliverReply({
2354
- replyResult: normalizedDeliveryPayload,
2355
- normalizedReplyResult: normalizedDeliveryPayload,
2356
- msg: params.msg,
2357
- mediaLocalRoots,
2358
- maxMediaBytes: params.maxMediaBytes,
2359
- textLimit,
2360
- chunkMode,
2361
- replyLogger: params.replyLogger,
2362
- connectionId: params.connectionId,
2363
- skipLog: false,
2364
- tableMode
2365
- })).providerAccepted) {
2366
- params.replyLogger.warn({
2367
- correlationId: params.msg.id ?? null,
2368
- connectionId: params.connectionId,
2369
- conversationId: params.conversationId,
2370
- chatId: params.msg.chatId,
2371
- to: params.msg.from,
2372
- from: params.msg.to,
2373
- replyKind: info.kind
2374
- }, "auto-reply was not accepted by WhatsApp provider");
2436
+ if (!reply.hasMedia) {
2437
+ logWhatsAppMediaOnlyFlushResult(await mediaOnlyCoalescer.flushAll());
2438
+ await deliverNormalizedPayload(normalizedDeliveryPayload, info);
2375
2439
  return;
2376
2440
  }
2377
- didSendReply = true;
2378
- const shouldLog = normalizedDeliveryPayload.text ? true : void 0;
2379
- params.rememberSentText(normalizedDeliveryPayload.text, {
2380
- combinedBody: params.context.Body,
2381
- combinedBodySessionKey: params.route.sessionKey,
2382
- logVerboseMessage: shouldLog
2383
- });
2384
- const fromDisplay = params.msg.chatType === "group" ? params.conversationId : params.msg.from ?? "unknown";
2385
- if (shouldLogVerbose$1()) logVerbose$1(`Reply body: ${normalizedDeliveryPayload.text != null ? reply.text : "<media>"}${reply.hasMedia ? " (media)" : ""} -> ${fromDisplay}`);
2441
+ const mediaUrls = getWhatsAppPayloadMediaUrls(normalizedDeliveryPayload);
2442
+ if (shouldDeferWhatsAppMediaOnlyPayload({
2443
+ info,
2444
+ mediaUrls,
2445
+ reply
2446
+ })) {
2447
+ mediaOnlyCoalescer.defer({
2448
+ info,
2449
+ mediaUrls,
2450
+ payload: normalizedDeliveryPayload
2451
+ });
2452
+ return;
2453
+ }
2454
+ logWhatsAppMediaOnlyFlushResult(await mediaOnlyCoalescer.flushExceptDuplicateMedia(mediaUrls));
2455
+ await deliverNormalizedPayload(normalizedDeliveryPayload, info);
2386
2456
  },
2387
2457
  onReplyStart: params.msg.sendComposing,
2388
2458
  onError: (err, info) => {
@@ -2402,6 +2472,7 @@ async function dispatchWhatsAppBufferedReply(params) {
2402
2472
  onModelSelected: params.onModelSelected
2403
2473
  }
2404
2474
  });
2475
+ logWhatsAppMediaOnlyFlushResult(await mediaOnlyCoalescer.flushAll());
2405
2476
  if (!hasVisibleInboundReplyDispatch({
2406
2477
  queuedFinal,
2407
2478
  counts
@@ -1,12 +1,12 @@
1
1
  import { t as resolveWhatsAppOutboundTarget } from "./resolve-outbound-target-CQ3Y1i0g.js";
2
- import { n as normalizeWhatsAppPayloadText } from "./outbound-media-contract-CGss_QHy.js";
3
- import { t as createWhatsAppOutboundBase } from "./outbound-base-Bq1UYEK5.js";
2
+ import { n as normalizeWhatsAppPayloadText } from "./outbound-media-contract-BPdOq7Hb.js";
3
+ import { t as createWhatsAppOutboundBase } from "./outbound-base-BmzhutvF.js";
4
4
  import { shouldLogVerbose } from "openclaw/plugin-sdk/runtime-env";
5
5
  import { chunkText } from "openclaw/plugin-sdk/reply-chunking";
6
6
  //#region extensions/whatsapp/src/outbound-adapter.ts
7
7
  let whatsAppSendModulePromise;
8
8
  function loadWhatsAppSendModule() {
9
- whatsAppSendModulePromise ??= import("./send-1CzaHJGH.js").then((n) => n.a);
9
+ whatsAppSendModulePromise ??= import("./send-CxctcFGT.js").then((n) => n.a);
10
10
  return whatsAppSendModulePromise;
11
11
  }
12
12
  function normalizeOutboundText(text) {
@@ -1,6 +1,6 @@
1
- import { s as toWhatsappJid } from "./text-runtime-C1zNiZeO.js";
2
- import { n as normalizeWhatsAppPayloadText, t as normalizeWhatsAppOutboundPayload } from "./outbound-media-contract-CGss_QHy.js";
3
- import { i as lookupInboundMessageMetaForTarget } from "./quoted-message-TENQzyxV.js";
1
+ import { s as toWhatsappJid } from "./text-runtime-DFFwk5z6.js";
2
+ import { n as normalizeWhatsAppPayloadText, t as normalizeWhatsAppOutboundPayload } from "./outbound-media-contract-BPdOq7Hb.js";
3
+ import { i as lookupInboundMessageMetaForTarget } from "./quoted-message-BXs55Teh.js";
4
4
  import { DEFAULT_ACCOUNT_ID, listCombinedAccountIds, normalizeOptionalAccountId, resolveListedDefaultAccountId } from "openclaw/plugin-sdk/account-core";
5
5
  import { createAttachedChannelResultAdapter } from "openclaw/plugin-sdk/channel-send-result";
6
6
  import { resolveOutboundSendDep } from "openclaw/plugin-sdk/outbound-send-deps";
@@ -1,5 +1,5 @@
1
1
  import { t as formatError } from "./session-errors-CSuKZPub.js";
2
- import { t as text_runtime_exports } from "./text-runtime-C1zNiZeO.js";
2
+ import { t as text_runtime_exports } from "./text-runtime-DFFwk5z6.js";
3
3
  import path from "node:path";
4
4
  import fs from "node:fs/promises";
5
5
  import { MEDIA_FFMPEG_MAX_AUDIO_DURATION_SECS, runFfmpeg } from "openclaw/plugin-sdk/media-runtime";
@@ -1,2 +1,2 @@
1
- import { t as whatsappOutbound } from "./outbound-adapter-CxwUJNMD.js";
1
+ import { t as whatsappOutbound } from "./outbound-adapter-CbR17Ehj.js";
2
2
  export { whatsappOutbound };
@@ -1,4 +1,4 @@
1
- import { i as jidToE164 } from "./text-runtime-C1zNiZeO.js";
1
+ import { i as jidToE164 } from "./text-runtime-DFFwk5z6.js";
2
2
  //#region extensions/whatsapp/src/quoted-message.ts
3
3
  const CACHE_TTL_MS = 600 * 1e3;
4
4
  const MAX_ENTRIES = 500;
@@ -1,15 +1,15 @@
1
1
  import { n as resolveWebCredsBackupPath, r as resolveWebCredsPath, t as hasWebCredsSync } from "./creds-files-_2V8jzQa.js";
2
- import { n as whatsAppActionRuntime, t as handleWhatsAppAction } from "./action-runtime-bsQE9CuK.js";
2
+ import { n as whatsAppActionRuntime, t as handleWhatsAppAction } from "./action-runtime-BqYZmBX_.js";
3
3
  import { n as getStatusCode, t as formatError } from "./session-errors-CSuKZPub.js";
4
- import { i as sendTypingWhatsApp, n as sendPollWhatsApp, r as sendReactionWhatsApp, t as sendMessageWhatsApp } from "./send-1CzaHJGH.js";
4
+ import { i as sendTypingWhatsApp, n as sendPollWhatsApp, r as sendReactionWhatsApp, t as sendMessageWhatsApp } from "./send-CxctcFGT.js";
5
5
  import { startWebLoginWithQr, waitForWebLogin } from "./login-qr-runtime.js";
6
6
  import { t as createWhatsAppLoginTool } from "./agent-tools-login-DpRxLNRB.js";
7
7
  import { n as setWhatsAppRuntime } from "./runtime-6fZ67abR.js";
8
- import { C as waitForCredsSaveQueueWithTimeout, S as waitForCredsSaveQueue, _ as readWebSelfIdentityForDecision, a as getWebAuthAgeMs, b as webAuthExists, c as pickWebChannel, d as readWebAuthExistsForDecision, f as readWebAuthSnapshot, g as readWebSelfIdentity, h as readWebSelfId, i as formatWhatsAppWebAuthStatusState, l as readCredsJsonRaw, m as readWebAuthState, n as WHATSAPP_AUTH_UNSTABLE_CODE, o as logWebSelfId, p as readWebAuthSnapshotBestEffort, r as WhatsAppAuthUnstableError, s as logoutWeb, t as WA_WEB_AUTH_DIR, u as readWebAuthExistsBestEffort, v as resolveDefaultWebAuthDir, w as writeCredsJsonAtomically, y as restoreCredsFromBackupIfNeeded } from "./auth-store-BjCb50Ry.js";
8
+ import { C as waitForCredsSaveQueueWithTimeout, S as waitForCredsSaveQueue, _ as readWebSelfIdentityForDecision, a as getWebAuthAgeMs, b as webAuthExists, c as pickWebChannel, d as readWebAuthExistsForDecision, f as readWebAuthSnapshot, g as readWebSelfIdentity, h as readWebSelfId, i as formatWhatsAppWebAuthStatusState, l as readCredsJsonRaw, m as readWebAuthState, n as WHATSAPP_AUTH_UNSTABLE_CODE, o as logWebSelfId, p as readWebAuthSnapshotBestEffort, r as WhatsAppAuthUnstableError, s as logoutWeb, t as WA_WEB_AUTH_DIR, u as readWebAuthExistsBestEffort, v as resolveDefaultWebAuthDir, w as writeCredsJsonAtomically, y as restoreCredsFromBackupIfNeeded } from "./auth-store-BNZmNP-s.js";
9
9
  import { t as DEFAULT_WEB_MEDIA_BYTES } from "./constants-DLGCIbfl.js";
10
10
  import { n as resolveWebAccountId, t as getActiveWebListener } from "./active-listener-N7GFKsuN.js";
11
- import { c as waitForWaConnection, o as createWaSocket, s as newConnectionId } from "./connection-controller-BSdlKQ56.js";
12
- import { a as loadWebMediaRaw, c as monitorWebInbox, d as extractMediaPlaceholder, f as extractText, i as loadWebMedia, l as extractContactContext, n as LocalMediaAccessError, o as optimizeImageToJpeg, p as resetWebInboundDedupe, r as getDefaultLocalRoots, s as optimizeImageToPng, t as monitorWebChannel, u as extractLocationData } from "./monitor-Ce7y4e_6.js";
13
- import { t as loginWeb } from "./login-ytUQ-aQa.js";
11
+ import { c as waitForWaConnection, o as createWaSocket, s as newConnectionId } from "./connection-controller-BCIuChXD.js";
12
+ import { a as loadWebMediaRaw, c as monitorWebInbox, d as extractMediaPlaceholder, f as extractText, i as loadWebMedia, l as extractContactContext, n as LocalMediaAccessError, o as optimizeImageToJpeg, p as resetWebInboundDedupe, r as getDefaultLocalRoots, s as optimizeImageToPng, t as monitorWebChannel, u as extractLocationData } from "./monitor-C5_C_RGJ.js";
13
+ import { t as loginWeb } from "./login-DSUTCcJ7.js";
14
14
  import { HEARTBEAT_PROMPT, HEARTBEAT_TOKEN, SILENT_REPLY_TOKEN, stripHeartbeatToken } from "openclaw/plugin-sdk/reply-runtime";
15
15
  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, extractMediaPlaceholder, 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 };
@@ -4,8 +4,8 @@ import { a as resolveWhatsAppAccount, s as resolveWhatsAppMediaMaxBytes } from "
4
4
  import { n as isWhatsAppNewsletterJid } from "./normalize-target-nXxC_hxG.js";
5
5
  import { t as getRegisteredWhatsAppConnectionController } from "./connection-controller-registry-D_iIGz5m.js";
6
6
  import "./normalize-Y3eBdM8a.js";
7
- import { a as markdownToWhatsApp, s as toWhatsappJid } from "./text-runtime-C1zNiZeO.js";
8
- import { a as resolveWhatsAppOutboundMediaUrls, i as prepareWhatsAppOutboundMedia, n as normalizeWhatsAppPayloadText } from "./outbound-media-contract-CGss_QHy.js";
7
+ import { a as markdownToWhatsApp, s as toWhatsappJid } from "./text-runtime-DFFwk5z6.js";
8
+ import { a as resolveWhatsAppOutboundMediaUrls, i as prepareWhatsAppOutboundMedia, n as normalizeWhatsAppPayloadText } from "./outbound-media-contract-BPdOq7Hb.js";
9
9
  import { formatCliCommand } from "openclaw/plugin-sdk/cli-runtime";
10
10
  import { generateSecureUuid } from "openclaw/plugin-sdk/core";
11
11
  import { redactIdentifier } from "openclaw/plugin-sdk/logging-core";
@@ -1,2 +1,2 @@
1
- import { t as whatsappSetupPlugin } from "./channel.setup-BeGeYs_M.js";
1
+ import { t as whatsappSetupPlugin } from "./channel.setup-BYtkDwHe.js";
2
2
  export { whatsappSetupPlugin };
@@ -1,7 +1,7 @@
1
1
  import { r as resolveDefaultWhatsAppAccountId, t as listAccountIds } from "./account-ids-DG18xddX.js";
2
2
  import { a as resolveWhatsAppAccount, o as resolveWhatsAppAuthDir } from "./accounts-BDqgpFEB.js";
3
3
  import { a as normalizeWhatsAppAllowFromEntries, o as normalizeWhatsAppAllowFromEntry } from "./normalize-target-nXxC_hxG.js";
4
- import { i as formatWhatsAppWebAuthStatusState, m as readWebAuthState } from "./auth-store-BjCb50Ry.js";
4
+ import { i as formatWhatsAppWebAuthStatusState, m as readWebAuthState } from "./auth-store-BNZmNP-s.js";
5
5
  import { t as whatsappSetupAdapter } from "./setup-core-DZKvpzbH.js";
6
6
  import path from "node:path";
7
7
  import { DEFAULT_ACCOUNT_ID, pathExists, setSetupChannelEnabled, splitSetupEntries } from "openclaw/plugin-sdk/setup";
@@ -280,7 +280,7 @@ async function finalizeWhatsAppSetup(params) {
280
280
  message: linked ? "WhatsApp already linked. Re-link now?" : "Link WhatsApp now (QR)?",
281
281
  initialValue: !linked
282
282
  })) try {
283
- const { loginWeb } = await import("./login-ytUQ-aQa.js").then((n) => n.n);
283
+ const { loginWeb } = await import("./login-DSUTCcJ7.js").then((n) => n.n);
284
284
  await loginWeb(false, void 0, params.runtime, accountId);
285
285
  } catch (error) {
286
286
  params.runtime.error(`WhatsApp login failed: ${String(error)}`);
@@ -124,10 +124,10 @@ function resolveWhatsAppConfigPath(params) {
124
124
  return `${resolveWhatsAppGroupScopeBasePath(params)}.${params.field}`;
125
125
  }
126
126
  async function loadWhatsAppChannelRuntime() {
127
- return await import("./channel.runtime-CXhHvkmj.js");
127
+ return await import("./channel.runtime-C3i9Svfj.js");
128
128
  }
129
129
  async function loadWhatsAppSetupSurface() {
130
- return await import("./setup-surface-D3xANmE7.js");
130
+ return await import("./setup-surface-CF3l3gEZ.js");
131
131
  }
132
132
  const whatsappSetupWizardProxy = createWhatsAppSetupWizardProxy(async () => (await loadWhatsAppSetupSurface()).whatsappSetupWizard);
133
133
  const whatsappConfigAdapter = createScopedChannelConfigAdapter({
package/dist/test-api.js CHANGED
@@ -1,3 +1,3 @@
1
1
  import { t as resolveWhatsAppRuntimeGroupPolicy } from "./runtime-group-policy-Gp1lQ0at.js";
2
- import { t as whatsappOutbound } from "./outbound-adapter-CxwUJNMD.js";
2
+ import { t as whatsappOutbound } from "./outbound-adapter-CbR17Ehj.js";
3
3
  export { resolveWhatsAppRuntimeGroupPolicy, whatsappOutbound };
@@ -28,6 +28,16 @@ function toWhatsappJid(number) {
28
28
  if (withoutPrefix.includes("@")) return withoutPrefix;
29
29
  return `${normalizeE164(withoutPrefix).replace(/\D/g, "")}@s.whatsapp.net`;
30
30
  }
31
+ function toWhatsappJidWithLid(number, opts) {
32
+ const stripped = number.replace(/^whatsapp:/i, "").trim();
33
+ if (stripped.includes("@")) return stripped;
34
+ const phoneDigits = normalizeE164(stripped).replace(/\D/g, "");
35
+ const lid = readLidForwardMapping({
36
+ phoneDigits,
37
+ opts
38
+ });
39
+ return lid ? `${lid}@lid` : `${phoneDigits}@s.whatsapp.net`;
40
+ }
31
41
  function resolveLidMappingDirs(params) {
32
42
  const dirs = /* @__PURE__ */ new Set();
33
43
  const addDir = (dir) => {
@@ -54,6 +64,21 @@ function readLidReverseMapping(params) {
54
64
  }
55
65
  return null;
56
66
  }
67
+ function readLidForwardMapping(params) {
68
+ const mappingFilename = `lid-mapping-${params.phoneDigits}.json`;
69
+ const mappingDirs = resolveLidMappingDirs({ opts: params.opts });
70
+ for (const dir of mappingDirs) {
71
+ const mappingPath = path.join(dir, mappingFilename);
72
+ try {
73
+ const data = fs.readFileSync(mappingPath, "utf8");
74
+ const lid = JSON.parse(data);
75
+ if (lid === null || lid === void 0) continue;
76
+ const digits = String(lid).replace(/\D/g, "");
77
+ if (digits) return digits;
78
+ } catch {}
79
+ }
80
+ return null;
81
+ }
57
82
  function jidToE164(jid, opts) {
58
83
  const match = jid.match(/^(\d+)(?::\d+)?@(s\.whatsapp\.net|hosted)$/);
59
84
  if (match) return `+${match[1]}`;
@@ -108,9 +133,10 @@ var text_runtime_exports = /* @__PURE__ */ __exportAll({
108
133
  jidToE164: () => jidToE164,
109
134
  markdownToWhatsApp: () => markdownToWhatsApp,
110
135
  resolveJidToE164: () => resolveJidToE164,
111
- toWhatsappJid: () => toWhatsappJid
136
+ toWhatsappJid: () => toWhatsappJid,
137
+ toWhatsappJidWithLid: () => toWhatsappJidWithLid
112
138
  });
113
139
  import * as import_openclaw_plugin_sdk_text_runtime from "openclaw/plugin-sdk/text-runtime";
114
140
  __reExport(text_runtime_exports, import_openclaw_plugin_sdk_text_runtime);
115
141
  //#endregion
116
- export { markdownToWhatsApp as a, jidToE164 as i, assertWebChannel as n, resolveJidToE164 as o, isSelfChatMode as r, toWhatsappJid as s, text_runtime_exports as t };
142
+ export { markdownToWhatsApp as a, toWhatsappJidWithLid as c, jidToE164 as i, assertWebChannel as n, resolveJidToE164 as o, isSelfChatMode as r, toWhatsappJid as s, text_runtime_exports as t };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openclaw/whatsapp",
3
- "version": "2026.5.6",
3
+ "version": "2026.5.7-beta.1",
4
4
  "description": "OpenClaw WhatsApp channel plugin",
5
5
  "repository": {
6
6
  "type": "git",
@@ -19,7 +19,7 @@
19
19
  "openclaw": "workspace:*"
20
20
  },
21
21
  "peerDependencies": {
22
- "openclaw": ">=2026.5.6"
22
+ "openclaw": ">=2026.5.7-beta.1"
23
23
  },
24
24
  "peerDependenciesMeta": {
25
25
  "openclaw": {
@@ -61,10 +61,10 @@
61
61
  "minHostVersion": ">=2026.4.25"
62
62
  },
63
63
  "compat": {
64
- "pluginApi": ">=2026.5.6"
64
+ "pluginApi": ">=2026.5.7-beta.1"
65
65
  },
66
66
  "build": {
67
- "openclawVersion": "2026.5.6"
67
+ "openclawVersion": "2026.5.7-beta.1"
68
68
  },
69
69
  "release": {
70
70
  "publishToClawHub": true,