@openclaw/whatsapp 2026.5.16-beta.4 → 2026.5.16-beta.6

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 (42) hide show
  1. package/dist/{access-control-Di_o41dj.js → access-control-CTFVk322.js} +3 -3
  2. package/dist/{account-ids-DG18xddX.js → account-ids-DgtV_RiP.js} +1 -1
  3. package/dist/{accounts-B4oR6Dhx.js → accounts-Dn7MUPTZ.js} +1 -1
  4. package/dist/{action-runtime-fgfdJlPZ.js → action-runtime-CnXRJ7y1.js} +2 -2
  5. package/dist/action-runtime-api.js +1 -1
  6. package/dist/action-runtime.runtime.js +1 -1
  7. package/dist/{active-listener-D2NHQ5Og.js → active-listener-C4ClVut4.js} +1 -1
  8. package/dist/api.js +12 -12
  9. package/dist/{auth-store-Cr3tg0Jm.js → auth-store-wR_4v9Z0.js} +28 -3
  10. package/dist/{channel-DBm3MwQ7.js → channel-Clt4IBN0.js} +10 -10
  11. package/dist/channel-plugin-api.js +1 -1
  12. package/dist/{channel-react-action-SxUVHy5Q.js → channel-react-action-UYINADWb.js} +2 -2
  13. package/dist/{channel.runtime-BrKncUJI.js → channel.runtime-CrkogIac.js} +5 -5
  14. package/dist/{channel.setup-JfQ9Dv9K.js → channel.setup-v-syzAcD.js} +6 -3
  15. package/dist/{connection-controller-YqKi6Ekq.js → connection-controller-BAxrz-1E.js} +3 -3
  16. package/dist/contract-api.js +2 -2
  17. package/dist/{directory-config-BLFmeNGN.js → directory-config-BfyInQuH.js} +1 -1
  18. package/dist/directory-contract-api.js +1 -1
  19. package/dist/{identity-BNDkpR8N.js → identity-CVFJuB0Q.js} +1 -1
  20. package/dist/light-runtime-api.js +3 -3
  21. package/dist/{login-CxQb0cqz.js → login-B30t_ENM.js} +4 -4
  22. package/dist/{login-qr-BCZXDJbM.js → login-qr-3DX2FJxJ.js} +4 -4
  23. package/dist/login-qr-runtime.js +1 -1
  24. package/dist/{monitor-D4UnxxWO.js → monitor-0P4gS6Tw.js} +12 -12
  25. package/dist/{outbound-adapter-C0p1kFXz.js → outbound-adapter-pW4J6iz-.js} +3 -3
  26. package/dist/{outbound-base-BMgWLjp4.js → outbound-base-Dfj1SAyO.js} +3 -3
  27. package/dist/{outbound-media-contract-BW560jdu.js → outbound-media-contract-CQnjZqsm.js} +18 -4
  28. package/dist/outbound-payload-test-api.js +1 -1
  29. package/dist/{quoted-message-BQsRXnac.js → quoted-message-C5vX90mp.js} +1 -1
  30. package/dist/runtime-api.js +9 -9
  31. package/dist/{send-CByjzdb_.js → send-Cn2WKdPM.js} +9 -6
  32. package/dist/{send-api-BNbwVO4e.js → send-api-CwheV1Iq.js} +13 -6
  33. package/dist/{session-B4Rnsd-V.js → session-CQXMIgyz.js} +7 -9
  34. package/dist/{setup-core-BFErZldJ.js → setup-core-CmeuY34a.js} +4 -4
  35. package/dist/{setup-finalize-CnTB-PeX.js → setup-finalize-Bgqs2cUL.js} +4 -4
  36. package/dist/setup-plugin-api.js +1 -1
  37. package/dist/{setup-surface-B5pabs1e.js → setup-surface-BY8ECdvP.js} +4 -4
  38. package/dist/test-api.js +1 -1
  39. package/package.json +5 -6
  40. /package/dist/{normalize-BZBRXai6.js → normalize-LMXvL6w0.js} +0 -0
  41. /package/dist/{session-errors-CSuKZPub.js → session-errors-KYQIoX8M.js} +0 -0
  42. /package/dist/{text-runtime-CMxQczvs.js → text-runtime-DyR0XOJ4.js} +0 -0
@@ -1,6 +1,6 @@
1
- import { a as resolveWhatsAppAccount } from "./accounts-B4oR6Dhx.js";
2
- import { l as isSelfChatMode, n as normalizeE164 } from "./text-runtime-CMxQczvs.js";
3
- import { a as getSelfIdentity, o as getSenderIdentity } from "./identity-BNDkpR8N.js";
1
+ import { a as resolveWhatsAppAccount } from "./accounts-Dn7MUPTZ.js";
2
+ import { l as isSelfChatMode, n as normalizeE164 } from "./text-runtime-DyR0XOJ4.js";
3
+ import { a as getSelfIdentity, o as getSenderIdentity } from "./identity-CVFJuB0Q.js";
4
4
  import { t as resolveWhatsAppRuntimeGroupPolicy } from "./runtime-group-policy-BH_U23qp.js";
5
5
  import { defaultRuntime } from "openclaw/plugin-sdk/runtime-env";
6
6
  import { resolveChannelGroupPolicy, resolveChannelGroupRequireMention } from "openclaw/plugin-sdk/channel-policy";
@@ -1,5 +1,5 @@
1
1
  import { createAccountListHelpers } from "openclaw/plugin-sdk/account-core";
2
2
  //#region extensions/whatsapp/src/account-ids.ts
3
- const { listConfiguredAccountIds, listAccountIds, resolveDefaultAccountId: resolveDefaultWhatsAppAccountId } = createAccountListHelpers("whatsapp");
3
+ const { listConfiguredAccountIds, listAccountIds, resolveDefaultAccountId: resolveDefaultWhatsAppAccountId } = createAccountListHelpers("whatsapp", { implicitDefaultAccount: { channelKeys: ["authDir"] } });
4
4
  //#endregion
5
5
  export { listConfiguredAccountIds as n, resolveDefaultWhatsAppAccountId as r, listAccountIds as t };
@@ -1,5 +1,5 @@
1
1
  import { t as resolveMergedWhatsAppAccountConfig } from "./account-config-CNQ33oav.js";
2
- import { n as listConfiguredAccountIds, r as resolveDefaultWhatsAppAccountId, t as listAccountIds } from "./account-ids-DG18xddX.js";
2
+ import { n as listConfiguredAccountIds, r as resolveDefaultWhatsAppAccountId, t as listAccountIds } from "./account-ids-DgtV_RiP.js";
3
3
  import { t as hasWebCredsSync } from "./creds-files-_2V8jzQa.js";
4
4
  import fs from "node:fs";
5
5
  import path from "node:path";
@@ -1,7 +1,7 @@
1
- import { a as resolveWhatsAppAccount } from "./accounts-B4oR6Dhx.js";
1
+ import { a as resolveWhatsAppAccount } from "./accounts-Dn7MUPTZ.js";
2
2
  import { t as resolveWhatsAppOutboundTarget } from "./resolve-outbound-target-Ba7sH80H.js";
3
3
  import { t as resolveWhatsAppReactionLevel } from "./reaction-level-2m9sWGCw.js";
4
- import { r as sendReactionWhatsApp } from "./send-CByjzdb_.js";
4
+ import { r as sendReactionWhatsApp } from "./send-Cn2WKdPM.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-fgfdJlPZ.js";
1
+ import { t as handleWhatsAppAction } from "./action-runtime-CnXRJ7y1.js";
2
2
  export { handleWhatsAppAction };
@@ -1,2 +1,2 @@
1
- import { t as handleWhatsAppAction } from "./action-runtime-fgfdJlPZ.js";
1
+ import { t as handleWhatsAppAction } from "./action-runtime-CnXRJ7y1.js";
2
2
  export { handleWhatsAppAction };
@@ -1,4 +1,4 @@
1
- import { r as resolveDefaultWhatsAppAccountId } from "./account-ids-DG18xddX.js";
1
+ import { r as resolveDefaultWhatsAppAccountId } from "./account-ids-DgtV_RiP.js";
2
2
  import { t as getRegisteredWhatsAppConnectionController } from "./connection-controller-registry-D_iIGz5m.js";
3
3
  //#region extensions/whatsapp/src/active-listener.ts
4
4
  function resolveWebAccountId(params) {
package/dist/api.js CHANGED
@@ -1,21 +1,21 @@
1
- import { r as resolveDefaultWhatsAppAccountId, t as listAccountIds } from "./account-ids-DG18xddX.js";
2
- import { a as resolveWhatsAppAccount, i as listWhatsAppAuthDirs, n as hasAnyWhatsAppAuth, o as resolveWhatsAppAuthDir, r as listEnabledWhatsAppAccounts, s as resolveWhatsAppMediaMaxBytes, t as DEFAULT_WHATSAPP_MEDIA_MAX_MB } from "./accounts-B4oR6Dhx.js";
1
+ import { r as resolveDefaultWhatsAppAccountId, t as listAccountIds } from "./account-ids-DgtV_RiP.js";
2
+ import { a as resolveWhatsAppAccount, i as listWhatsAppAuthDirs, n as hasAnyWhatsAppAuth, o as resolveWhatsAppAuthDir, r as listEnabledWhatsAppAccounts, s as resolveWhatsAppMediaMaxBytes, t as DEFAULT_WHATSAPP_MEDIA_MAX_MB } from "./accounts-Dn7MUPTZ.js";
3
3
  import { a as normalizeWhatsAppAllowFromEntries, c as normalizeWhatsAppTarget, i as looksLikeWhatsAppTargetId, r as isWhatsAppUserTarget, s as normalizeWhatsAppMessagingTarget, t as isWhatsAppGroupJid } from "./normalize-target-MB6Z_4Bn.js";
4
4
  import { t as resolveWhatsAppOutboundTarget } from "./resolve-outbound-target-Ba7sH80H.js";
5
5
  import "./reaction-level-2m9sWGCw.js";
6
- import { c as assertWebChannel, d as markdownToWhatsApp, f as resolveJidToE164, l as isSelfChatMode, m as toWhatsappJidWithLid, n as normalizeE164, p as toWhatsappJid, r as resolveUserPath, u as jidToE164 } from "./text-runtime-CMxQczvs.js";
7
- import "./send-CByjzdb_.js";
8
- import { t as whatsappPlugin } from "./channel-DBm3MwQ7.js";
9
- import { n as WHATSAPP_LEGACY_OUTBOUND_SEND_DEP_KEYS } from "./outbound-base-BMgWLjp4.js";
6
+ import { c as assertWebChannel, d as markdownToWhatsApp, f as resolveJidToE164, l as isSelfChatMode, m as toWhatsappJidWithLid, n as normalizeE164, p as toWhatsappJid, r as resolveUserPath, u as jidToE164 } from "./text-runtime-DyR0XOJ4.js";
7
+ import "./send-Cn2WKdPM.js";
8
+ import { t as whatsappPlugin } from "./channel-Clt4IBN0.js";
9
+ import { n as WHATSAPP_LEGACY_OUTBOUND_SEND_DEP_KEYS } from "./outbound-base-Dfj1SAyO.js";
10
10
  import { t as whatsappCommandPolicy } from "./command-policy-O8sRnqUV.js";
11
- import { a as resolveWhatsAppGroupRequireMention, o as resolveWhatsAppGroupToolPolicy, s as resolveWhatsAppGroupIntroHint } from "./setup-core-BFErZldJ.js";
11
+ import { a as resolveWhatsAppGroupRequireMention, o as resolveWhatsAppGroupToolPolicy, s as resolveWhatsAppGroupIntroHint } from "./setup-core-CmeuY34a.js";
12
12
  import "./config-schema-Dmo66Ubb.js";
13
- import { t as whatsappSetupPlugin } from "./channel.setup-JfQ9Dv9K.js";
13
+ import { t as whatsappSetupPlugin } from "./channel.setup-v-syzAcD.js";
14
14
  import { t as DEFAULT_WEB_MEDIA_BYTES } from "./constants-yKXGCGU9.js";
15
- import { n as listWhatsAppDirectoryGroupsFromConfig, r as listWhatsAppDirectoryPeersFromConfig } from "./directory-config-BLFmeNGN.js";
16
- import { t as __testing } from "./access-control-Di_o41dj.js";
17
- import { p as extractText, t as createWebSendApi } from "./send-api-BNbwVO4e.js";
18
- import { r as waitForWaConnection, t as createWaSocket } from "./session-B4Rnsd-V.js";
15
+ import { n as listWhatsAppDirectoryGroupsFromConfig, r as listWhatsAppDirectoryPeersFromConfig } from "./directory-config-BfyInQuH.js";
16
+ import { t as __testing } from "./access-control-CTFVk322.js";
17
+ import { p as extractText, t as createWebSendApi } from "./send-api-CwheV1Iq.js";
18
+ import { r as waitForWaConnection, t as createWaSocket } from "./session-CQXMIgyz.js";
19
19
  import "openclaw/plugin-sdk/channel-actions";
20
20
  import "openclaw/plugin-sdk/account-resolution";
21
21
  import "openclaw/plugin-sdk/core";
@@ -1,6 +1,7 @@
1
+ import { t as __exportAll } from "./rolldown-runtime-CiIaOW0V.js";
1
2
  import { n as resolveWebCredsBackupPath, r as resolveWebCredsPath } from "./creds-files-_2V8jzQa.js";
2
- import { r as resolveUserPath } from "./text-runtime-CMxQczvs.js";
3
- import { c as resolveComparableIdentity } from "./identity-BNDkpR8N.js";
3
+ import { r as resolveUserPath } from "./text-runtime-DyR0XOJ4.js";
4
+ import { c as resolveComparableIdentity } from "./identity-CVFJuB0Q.js";
4
5
  import fs from "node:fs";
5
6
  import path from "node:path";
6
7
  import { resolveOAuthDir as resolveOAuthDir$1 } from "openclaw/plugin-sdk/state-paths";
@@ -50,6 +51,30 @@ async function waitForCredsSaveQueueWithTimeout(authDir, timeoutMs = CREDS_SAVE_
50
51
  }
51
52
  //#endregion
52
53
  //#region extensions/whatsapp/src/auth-store.ts
54
+ var auth_store_exports = /* @__PURE__ */ __exportAll({
55
+ WA_WEB_AUTH_DIR: () => WA_WEB_AUTH_DIR,
56
+ WHATSAPP_AUTH_UNSTABLE_CODE: () => WHATSAPP_AUTH_UNSTABLE_CODE,
57
+ WhatsAppAuthUnstableError: () => WhatsAppAuthUnstableError,
58
+ formatWhatsAppWebAuthStatusState: () => formatWhatsAppWebAuthStatusState,
59
+ getWebAuthAgeMs: () => getWebAuthAgeMs,
60
+ logWebSelfId: () => logWebSelfId,
61
+ logoutWeb: () => logoutWeb,
62
+ pickWebChannel: () => pickWebChannel,
63
+ readCredsJsonRaw: () => readCredsJsonRaw,
64
+ readWebAuthExistsBestEffort: () => readWebAuthExistsBestEffort,
65
+ readWebAuthExistsForDecision: () => readWebAuthExistsForDecision,
66
+ readWebAuthSnapshot: () => readWebAuthSnapshot,
67
+ readWebAuthSnapshotBestEffort: () => readWebAuthSnapshotBestEffort,
68
+ readWebAuthState: () => readWebAuthState,
69
+ readWebSelfId: () => readWebSelfId,
70
+ readWebSelfIdentity: () => readWebSelfIdentity,
71
+ readWebSelfIdentityForDecision: () => readWebSelfIdentityForDecision,
72
+ resolveDefaultWebAuthDir: () => resolveDefaultWebAuthDir,
73
+ resolveWebCredsBackupPath: () => resolveWebCredsBackupPath,
74
+ resolveWebCredsPath: () => resolveWebCredsPath,
75
+ restoreCredsFromBackupIfNeeded: () => restoreCredsFromBackupIfNeeded,
76
+ webAuthExists: () => webAuthExists
77
+ });
53
78
  const WHATSAPP_AUTH_UNSTABLE_CODE = "whatsapp-auth-unstable";
54
79
  const authStoreLogger = getChildLogger({ module: "web-auth-store" });
55
80
  const emptyWebSelfId = () => ({
@@ -356,4 +381,4 @@ async function pickWebChannel(pref, authDir = resolveDefaultWebAuthDir()) {
356
381
  return choice;
357
382
  }
358
383
  //#endregion
359
- export { waitForCredsSaveQueueWithTimeout as C, waitForCredsSaveQueue as S, readWebSelfIdentityForDecision as _, getWebAuthAgeMs as a, webAuthExists as b, pickWebChannel as c, readWebAuthExistsForDecision as d, readWebAuthSnapshot as f, readWebSelfIdentity as g, readWebSelfId as h, formatWhatsAppWebAuthStatusState as i, readCredsJsonRaw as l, readWebAuthState as m, WHATSAPP_AUTH_UNSTABLE_CODE as n, logWebSelfId as o, readWebAuthSnapshotBestEffort as p, WhatsAppAuthUnstableError as r, logoutWeb as s, WA_WEB_AUTH_DIR as t, readWebAuthExistsBestEffort as u, resolveDefaultWebAuthDir as v, writeCredsJsonAtomically as w, enqueueCredsSave as x, restoreCredsFromBackupIfNeeded as y };
384
+ export { waitForCredsSaveQueue as C, enqueueCredsSave as S, writeCredsJsonAtomically as T, readWebSelfIdentity as _, formatWhatsAppWebAuthStatusState as a, restoreCredsFromBackupIfNeeded as b, logoutWeb as c, readWebAuthExistsBestEffort as d, readWebAuthExistsForDecision as f, readWebSelfId as g, readWebAuthState as h, auth_store_exports as i, pickWebChannel as l, readWebAuthSnapshotBestEffort as m, WHATSAPP_AUTH_UNSTABLE_CODE as n, getWebAuthAgeMs as o, readWebAuthSnapshot as p, WhatsAppAuthUnstableError as r, logWebSelfId as s, WA_WEB_AUTH_DIR as t, readCredsJsonRaw as u, readWebSelfIdentityForDecision as v, waitForCredsSaveQueueWithTimeout as w, webAuthExists as x, resolveDefaultWebAuthDir as y };
@@ -1,17 +1,17 @@
1
- import { t as listAccountIds } from "./account-ids-DG18xddX.js";
2
- import { a as resolveWhatsAppAccount } from "./accounts-B4oR6Dhx.js";
1
+ import { t as listAccountIds } from "./account-ids-DgtV_RiP.js";
2
+ import { a as resolveWhatsAppAccount } from "./accounts-Dn7MUPTZ.js";
3
3
  import { c as normalizeWhatsAppTarget, i as looksLikeWhatsAppTargetId, n as isWhatsAppNewsletterJid, o as normalizeWhatsAppAllowFromEntry, s as normalizeWhatsAppMessagingTarget, t as isWhatsAppGroupJid } from "./normalize-target-MB6Z_4Bn.js";
4
4
  import { t as resolveWhatsAppOutboundTarget } from "./resolve-outbound-target-Ba7sH80H.js";
5
5
  import { t as resolveWhatsAppReactionLevel } from "./reaction-level-2m9sWGCw.js";
6
- import "./normalize-BZBRXai6.js";
7
- import { r as normalizeWhatsAppPayloadTextPreservingIndentation } from "./outbound-media-contract-BW560jdu.js";
8
- import { i as sendTypingWhatsApp, n as sendPollWhatsApp, t as sendMessageWhatsApp } from "./send-CByjzdb_.js";
6
+ import { r as normalizeWhatsAppPayloadTextPreservingIndentation } from "./outbound-media-contract-CQnjZqsm.js";
7
+ import "./normalize-LMXvL6w0.js";
8
+ import { i as sendTypingWhatsApp, n as sendPollWhatsApp, t as sendMessageWhatsApp } from "./send-Cn2WKdPM.js";
9
9
  import { t as createWhatsAppLoginTool } from "./agent-tools-login-DpRxLNRB.js";
10
- import { t as createWhatsAppOutboundBase } from "./outbound-base-BMgWLjp4.js";
10
+ import { t as createWhatsAppOutboundBase } from "./outbound-base-Dfj1SAyO.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 resolveWhatsAppGroupRequireMention, c as resolveWhatsAppMentionStripRegexes, i as whatsappSetupWizardProxy, l as formatWhatsAppConfigAllowFromEntries, n as createWhatsAppPluginBase, o as resolveWhatsAppGroupToolPolicy, r as loadWhatsAppChannelRuntime, s as resolveWhatsAppGroupIntroHint, t as whatsappSetupAdapter } from "./setup-core-BFErZldJ.js";
14
- import { d as readWebAuthExistsForDecision, n as WHATSAPP_AUTH_UNSTABLE_CODE } from "./auth-store-Cr3tg0Jm.js";
13
+ import { a as resolveWhatsAppGroupRequireMention, c as resolveWhatsAppMentionStripRegexes, i as whatsappSetupWizardProxy, l as formatWhatsAppConfigAllowFromEntries, n as createWhatsAppPluginBase, o as resolveWhatsAppGroupToolPolicy, r as loadWhatsAppChannelRuntime, s as resolveWhatsAppGroupIntroHint, t as whatsappSetupAdapter } from "./setup-core-CmeuY34a.js";
14
+ import { f as readWebAuthExistsForDecision, n as WHATSAPP_AUTH_UNSTABLE_CODE } from "./auth-store-wR_4v9Z0.js";
15
15
  import { t as detectWhatsAppLegacyStateMigrations } from "./state-migrations-CtdIArlK.js";
16
16
  import { createActionGate as createActionGate$1 } from "openclaw/plugin-sdk/channel-actions";
17
17
  import { asString, collectIssuesForEnabledAccounts, createAsyncComputedAccountStatusAdapter, createDefaultChannelRuntimeState, isRecord } from "openclaw/plugin-sdk/status-helpers";
@@ -321,8 +321,8 @@ function collectWhatsAppStatusIssues(accounts) {
321
321
  }
322
322
  //#endregion
323
323
  //#region extensions/whatsapp/src/channel.ts
324
- const loadWhatsAppDirectoryConfig = createLazyRuntimeModule(() => import("./directory-config-BLFmeNGN.js").then((n) => n.t));
325
- const loadWhatsAppChannelReactAction = createLazyRuntimeModule(() => import("./channel-react-action-SxUVHy5Q.js"));
324
+ const loadWhatsAppDirectoryConfig = createLazyRuntimeModule(() => import("./directory-config-BfyInQuH.js").then((n) => n.t));
325
+ const loadWhatsAppChannelReactAction = createLazyRuntimeModule(() => import("./channel-react-action-UYINADWb.js"));
326
326
  function parseWhatsAppExplicitTarget(raw) {
327
327
  const normalized = normalizeWhatsAppTarget(raw);
328
328
  if (!normalized) return null;
@@ -1,2 +1,2 @@
1
- import { t as whatsappPlugin } from "./channel-DBm3MwQ7.js";
1
+ import { t as whatsappPlugin } from "./channel-Clt4IBN0.js";
2
2
  export { whatsappPlugin };
@@ -1,6 +1,6 @@
1
1
  import { c as normalizeWhatsAppTarget, t as isWhatsAppGroupJid } from "./normalize-target-MB6Z_4Bn.js";
2
- import { t as handleWhatsAppAction } from "./action-runtime-fgfdJlPZ.js";
3
- import "./normalize-BZBRXai6.js";
2
+ import { t as handleWhatsAppAction } from "./action-runtime-CnXRJ7y1.js";
3
+ import "./normalize-LMXvL6w0.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
6
6
  const WHATSAPP_CHANNEL = "whatsapp";
@@ -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-Cr3tg0Jm.js";
3
- import { t as getActiveWebListener$1 } from "./active-listener-D2NHQ5Og.js";
4
- import { t as monitorWebChannel$1 } from "./monitor-D4UnxxWO.js";
5
- import { t as loginWeb$1 } from "./login-CxQb0cqz.js";
6
- import { whatsappSetupWizard as whatsappSetupWizard$1 } from "./setup-surface-B5pabs1e.js";
2
+ import { c as logoutWeb$1, d as readWebAuthExistsBestEffort$1, f as readWebAuthExistsForDecision$1, g as readWebSelfId$1, h as readWebAuthState$1, m as readWebAuthSnapshotBestEffort$1, o as getWebAuthAgeMs$1, p as readWebAuthSnapshot$1, s as logWebSelfId$1, x as webAuthExists$1 } from "./auth-store-wR_4v9Z0.js";
3
+ import { t as getActiveWebListener$1 } from "./active-listener-C4ClVut4.js";
4
+ import { t as monitorWebChannel$1 } from "./monitor-0P4gS6Tw.js";
5
+ import { t as loginWeb$1 } from "./login-B30t_ENM.js";
6
+ import { whatsappSetupWizard as whatsappSetupWizard$1 } from "./setup-surface-BY8ECdvP.js";
7
7
  //#region extensions/whatsapp/src/channel.runtime.ts
8
8
  function getActiveWebListener(...args) {
9
9
  return getActiveWebListener$1(...args);
@@ -1,7 +1,10 @@
1
- import { a as resolveWhatsAppGroupRequireMention, i as whatsappSetupWizardProxy, n as createWhatsAppPluginBase, o as resolveWhatsAppGroupToolPolicy, s as resolveWhatsAppGroupIntroHint, t as whatsappSetupAdapter } from "./setup-core-BFErZldJ.js";
2
- import { m as readWebAuthState } from "./auth-store-Cr3tg0Jm.js";
1
+ import { a as resolveWhatsAppGroupRequireMention, i as whatsappSetupWizardProxy, n as createWhatsAppPluginBase, o as resolveWhatsAppGroupToolPolicy, s as resolveWhatsAppGroupIntroHint, t as whatsappSetupAdapter } from "./setup-core-CmeuY34a.js";
3
2
  import { t as detectWhatsAppLegacyStateMigrations } from "./state-migrations-CtdIArlK.js";
4
3
  //#region extensions/whatsapp/src/channel.setup.ts
4
+ async function isWhatsAppAuthConfigured(account) {
5
+ const { readWebAuthState } = await import("./auth-store-wR_4v9Z0.js").then((n) => n.i);
6
+ return await readWebAuthState(account.authDir) === "linked";
7
+ }
5
8
  const whatsappSetupPlugin = {
6
9
  ...createWhatsAppPluginBase({
7
10
  groups: {
@@ -11,7 +14,7 @@ const whatsappSetupPlugin = {
11
14
  },
12
15
  setupWizard: whatsappSetupWizardProxy,
13
16
  setup: whatsappSetupAdapter,
14
- isConfigured: async (account) => await readWebAuthState(account.authDir) === "linked"
17
+ isConfigured: isWhatsAppAuthConfigured
15
18
  }),
16
19
  lifecycle: { detectLegacyStateMigrations: ({ oauthDir }) => detectWhatsAppLegacyStateMigrations({ oauthDir }) }
17
20
  };
@@ -1,7 +1,7 @@
1
1
  import { n as registerWhatsAppConnectionController, r as unregisterWhatsAppConnectionController } from "./connection-controller-registry-D_iIGz5m.js";
2
- import { n as getStatusCode, t as formatError } from "./session-errors-CSuKZPub.js";
3
- import { s as logoutWeb } from "./auth-store-Cr3tg0Jm.js";
4
- import { r as waitForWaConnection, t as createWaSocket } from "./session-B4Rnsd-V.js";
2
+ import { n as getStatusCode, t as formatError } from "./session-errors-KYQIoX8M.js";
3
+ import { c as logoutWeb } from "./auth-store-wR_4v9Z0.js";
4
+ import { r as waitForWaConnection, t as createWaSocket } from "./session-CQXMIgyz.js";
5
5
  import { computeBackoff, info, sleepWithAbort } from "openclaw/plugin-sdk/runtime-env";
6
6
  import { clamp } from "openclaw/plugin-sdk/text-utility-runtime";
7
7
  import { DisconnectReason } from "baileys";
@@ -3,9 +3,9 @@ import { t as whatsappCommandPolicy$1 } from "./command-policy-O8sRnqUV.js";
3
3
  import { t as resolveLegacyGroupSessionKey$1 } from "./group-session-contract-DdqigLJl.js";
4
4
  import { n as unsupportedSecretRefSurfacePatterns, t as collectUnsupportedSecretRefConfigCandidates } from "./security-contract-CvfWex9e.js";
5
5
  import { r as isLegacyGroupSessionKey$1, t as canonicalizeLegacySessionKey$1 } from "./session-contract-B0efQf9P.js";
6
- import { n as listWhatsAppDirectoryGroupsFromConfig, r as listWhatsAppDirectoryPeersFromConfig } from "./directory-config-BLFmeNGN.js";
6
+ import { n as listWhatsAppDirectoryGroupsFromConfig, r as listWhatsAppDirectoryPeersFromConfig } from "./directory-config-BfyInQuH.js";
7
7
  import { t as resolveWhatsAppRuntimeGroupPolicy$1 } from "./runtime-group-policy-BH_U23qp.js";
8
- import { t as __testing } from "./access-control-Di_o41dj.js";
8
+ import { t as __testing } from "./access-control-CTFVk322.js";
9
9
  //#region extensions/whatsapp/contract-api.ts
10
10
  const canonicalizeLegacySessionKey = canonicalizeLegacySessionKey$1;
11
11
  const isLegacyGroupSessionKey = isLegacyGroupSessionKey$1;
@@ -1,7 +1,7 @@
1
1
  import { t as __exportAll } from "./rolldown-runtime-CiIaOW0V.js";
2
2
  import { t as resolveMergedWhatsAppAccountConfig } from "./account-config-CNQ33oav.js";
3
3
  import { c as normalizeWhatsAppTarget, t as isWhatsAppGroupJid } from "./normalize-target-MB6Z_4Bn.js";
4
- import "./normalize-BZBRXai6.js";
4
+ import "./normalize-LMXvL6w0.js";
5
5
  import { listResolvedDirectoryGroupEntriesFromMapKeys, listResolvedDirectoryUserEntriesFromAllowFrom } from "openclaw/plugin-sdk/directory-config-runtime";
6
6
  //#region extensions/whatsapp/src/directory-config.ts
7
7
  var directory_config_exports = /* @__PURE__ */ __exportAll({
@@ -1,2 +1,2 @@
1
- import { n as listWhatsAppDirectoryGroupsFromConfig, r as listWhatsAppDirectoryPeersFromConfig } from "./directory-config-BLFmeNGN.js";
1
+ import { n as listWhatsAppDirectoryGroupsFromConfig, r as listWhatsAppDirectoryPeersFromConfig } from "./directory-config-BfyInQuH.js";
2
2
  export { listWhatsAppDirectoryGroupsFromConfig, listWhatsAppDirectoryPeersFromConfig };
@@ -1,4 +1,4 @@
1
- import { n as normalizeE164, u as jidToE164 } from "./text-runtime-CMxQczvs.js";
1
+ import { n as normalizeE164, u as jidToE164 } from "./text-runtime-DyR0XOJ4.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
- import { n as getStatusCode, t as formatError } from "./session-errors-CSuKZPub.js";
1
+ import { n as getStatusCode, t as formatError } from "./session-errors-KYQIoX8M.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-Cr3tg0Jm.js";
4
- import { t as getActiveWebListener } from "./active-listener-D2NHQ5Og.js";
3
+ import { c as logoutWeb, g as readWebSelfId, l as pickWebChannel, o as getWebAuthAgeMs, s as logWebSelfId, t as WA_WEB_AUTH_DIR, x as webAuthExists } from "./auth-store-wR_4v9Z0.js";
4
+ import { t as getActiveWebListener } from "./active-listener-C4ClVut4.js";
5
5
  export { WA_WEB_AUTH_DIR, createWhatsAppLoginTool, formatError, getActiveWebListener, getStatusCode, getWebAuthAgeMs, logWebSelfId, logoutWeb, pickWebChannel, readWebSelfId, webAuthExists };
@@ -1,8 +1,8 @@
1
1
  import { t as __exportAll } from "./rolldown-runtime-CiIaOW0V.js";
2
- import { a as resolveWhatsAppAccount } from "./accounts-B4oR6Dhx.js";
3
- import { y as restoreCredsFromBackupIfNeeded } from "./auth-store-Cr3tg0Jm.js";
4
- import { a as renderQrTerminal, i as resolveWhatsAppSocketTiming, t as createWaSocket } from "./session-B4Rnsd-V.js";
5
- import { a as closeWaSocketSoon, o as waitForWhatsAppLoginResult } from "./connection-controller-YqKi6Ekq.js";
2
+ import { a as resolveWhatsAppAccount } from "./accounts-Dn7MUPTZ.js";
3
+ import { b as restoreCredsFromBackupIfNeeded } from "./auth-store-wR_4v9Z0.js";
4
+ import { a as renderQrTerminal, i as resolveWhatsAppSocketTiming, t as createWaSocket } from "./session-CQXMIgyz.js";
5
+ import { a as closeWaSocketSoon, o as waitForWhatsAppLoginResult } from "./connection-controller-BAxrz-1E.js";
6
6
  import { formatCliCommand } from "openclaw/plugin-sdk/cli-runtime";
7
7
  import { logInfo } from "openclaw/plugin-sdk/logging-core";
8
8
  import { danger, defaultRuntime, success } from "openclaw/plugin-sdk/runtime-env";
@@ -1,7 +1,7 @@
1
- import { a as resolveWhatsAppAccount } from "./accounts-B4oR6Dhx.js";
2
- import { d as readWebAuthExistsForDecision, h as readWebSelfId, n as WHATSAPP_AUTH_UNSTABLE_CODE } from "./auth-store-Cr3tg0Jm.js";
3
- import { i as resolveWhatsAppSocketTiming, t as createWaSocket } from "./session-B4Rnsd-V.js";
4
- import { i as closeWaSocket, o as waitForWhatsAppLoginResult, t as WHATSAPP_LOGGED_OUT_QR_MESSAGE } from "./connection-controller-YqKi6Ekq.js";
1
+ import { a as resolveWhatsAppAccount } from "./accounts-Dn7MUPTZ.js";
2
+ import { f as readWebAuthExistsForDecision, g as readWebSelfId, n as WHATSAPP_AUTH_UNSTABLE_CODE } from "./auth-store-wR_4v9Z0.js";
3
+ import { i as resolveWhatsAppSocketTiming, t as createWaSocket } from "./session-CQXMIgyz.js";
4
+ import { i as closeWaSocket, o as waitForWhatsAppLoginResult, t as WHATSAPP_LOGGED_OUT_QR_MESSAGE } from "./connection-controller-BAxrz-1E.js";
5
5
  import { logInfo } from "openclaw/plugin-sdk/logging-core";
6
6
  import { danger, defaultRuntime, info, success } from "openclaw/plugin-sdk/runtime-env";
7
7
  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-BCZXDJbM.js");
4
+ loginQrModulePromise ??= import("./login-qr-3DX2FJxJ.js");
5
5
  return loginQrModulePromise;
6
6
  }
7
7
  async function startWebLoginWithQr(...args) {
@@ -1,17 +1,17 @@
1
- import { a as resolveWhatsAppAccount, s as resolveWhatsAppMediaMaxBytes } from "./accounts-B4oR6Dhx.js";
1
+ import { a as resolveWhatsAppAccount, s as resolveWhatsAppMediaMaxBytes } from "./accounts-Dn7MUPTZ.js";
2
2
  import { t as isWhatsAppGroupJid } from "./normalize-target-MB6Z_4Bn.js";
3
3
  import { t as resolveWhatsAppReactionLevel } from "./reaction-level-2m9sWGCw.js";
4
- import { n as getStatusCode, t as formatError } from "./session-errors-CSuKZPub.js";
5
- import { d as markdownToWhatsApp, f as resolveJidToE164, l as isSelfChatMode, n as normalizeE164, t as convertMarkdownTables$1, u as jidToE164 } from "./text-runtime-CMxQczvs.js";
6
- import { i as prepareWhatsAppOutboundMedia, o as sendWhatsAppOutboundWithRetry, r as normalizeWhatsAppPayloadTextPreservingIndentation, t as normalizeWhatsAppOutboundPayload } from "./outbound-media-contract-BW560jdu.js";
7
- import { r as sendReactionWhatsApp } from "./send-CByjzdb_.js";
8
- import { n as cacheInboundMessageMeta, r as lookupInboundMessageMeta, t as buildQuotedMessageOptions } from "./quoted-message-BQsRXnac.js";
9
- import { _ as readWebSelfIdentityForDecision, a as getWebAuthAgeMs, h as readWebSelfId, r as WhatsAppAuthUnstableError, s as logoutWeb } from "./auth-store-Cr3tg0Jm.js";
10
- 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-BNDkpR8N.js";
11
- import { i as resolveWhatsAppInboundPolicy, n as checkInboundAccessControl, r as resolveWhatsAppCommandAuthorized } from "./access-control-Di_o41dj.js";
12
- import { a as mayContainWhatsAppOutboundMention, c as extractContactContext, d as extractMediaPlaceholder, f as extractMentionedJids, i as addWhatsAppOutboundMentionsToContent, l as extractContextInfo, m as hasInboundUserContent, n as listWhatsAppSendResultMessageIds, o as resolveWhatsAppOutboundMentions, p as extractText, r as normalizeWhatsAppSendResult, s as describeReplyContext, t as createWebSendApi, u as extractLocationData } from "./send-api-BNbwVO4e.js";
13
- import { i as resolveWhatsAppSocketTiming, r as waitForWaConnection, t as createWaSocket } from "./session-B4Rnsd-V.js";
14
- import { c as computeBackoff, d as resolveReconnectPolicy, f as sleepWithAbort, l as newConnectionId, n as WHATSAPP_WATCHDOG_TIMEOUT_ERROR, r as WhatsAppConnectionController, s as DEFAULT_RECONNECT_POLICY, u as resolveHeartbeatSeconds } from "./connection-controller-YqKi6Ekq.js";
4
+ import { i as prepareWhatsAppOutboundMedia, o as sendWhatsAppOutboundWithRetry, r as normalizeWhatsAppPayloadTextPreservingIndentation, t as normalizeWhatsAppOutboundPayload } from "./outbound-media-contract-CQnjZqsm.js";
5
+ import { n as getStatusCode, t as formatError } from "./session-errors-KYQIoX8M.js";
6
+ import { d as markdownToWhatsApp, f as resolveJidToE164, l as isSelfChatMode, n as normalizeE164, t as convertMarkdownTables$1, u as jidToE164 } from "./text-runtime-DyR0XOJ4.js";
7
+ import { r as sendReactionWhatsApp } from "./send-Cn2WKdPM.js";
8
+ import { n as cacheInboundMessageMeta, r as lookupInboundMessageMeta, t as buildQuotedMessageOptions } from "./quoted-message-C5vX90mp.js";
9
+ import { c as logoutWeb, g as readWebSelfId, o as getWebAuthAgeMs, r as WhatsAppAuthUnstableError, v as readWebSelfIdentityForDecision } from "./auth-store-wR_4v9Z0.js";
10
+ 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-CVFJuB0Q.js";
11
+ import { i as resolveWhatsAppInboundPolicy, n as checkInboundAccessControl, r as resolveWhatsAppCommandAuthorized } from "./access-control-CTFVk322.js";
12
+ import { a as mayContainWhatsAppOutboundMention, c as extractContactContext, d as extractMediaPlaceholder, f as extractMentionedJids, i as addWhatsAppOutboundMentionsToContent, l as extractContextInfo, m as hasInboundUserContent, n as listWhatsAppSendResultMessageIds, o as resolveWhatsAppOutboundMentions, p as extractText, r as normalizeWhatsAppSendResult, s as describeReplyContext, t as createWebSendApi, u as extractLocationData } from "./send-api-CwheV1Iq.js";
13
+ import { i as resolveWhatsAppSocketTiming, r as waitForWaConnection, t as createWaSocket } from "./session-CQXMIgyz.js";
14
+ import { c as computeBackoff, d as resolveReconnectPolicy, f as sleepWithAbort, l as newConnectionId, n as WHATSAPP_WATCHDOG_TIMEOUT_ERROR, r as WhatsAppConnectionController, s as DEFAULT_RECONNECT_POLICY, u as resolveHeartbeatSeconds } from "./connection-controller-BAxrz-1E.js";
15
15
  import { resolveAccountEntry } from "openclaw/plugin-sdk/account-core";
16
16
  import { normalizeLowercaseStringOrEmpty } from "openclaw/plugin-sdk/string-coerce-runtime";
17
17
  import { DEFAULT_TIMING, createAckReactionHandle, createStatusReactionController, logAckFailure, removeAckReactionHandleAfterReply, shouldAckReactionForWhatsApp } from "openclaw/plugin-sdk/channel-feedback";
@@ -1,12 +1,12 @@
1
1
  import { t as resolveWhatsAppOutboundTarget } from "./resolve-outbound-target-Ba7sH80H.js";
2
- import { n as normalizeWhatsAppPayloadText } from "./outbound-media-contract-BW560jdu.js";
3
- import { t as createWhatsAppOutboundBase } from "./outbound-base-BMgWLjp4.js";
2
+ import { n as normalizeWhatsAppPayloadText } from "./outbound-media-contract-CQnjZqsm.js";
3
+ import { t as createWhatsAppOutboundBase } from "./outbound-base-Dfj1SAyO.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-CByjzdb_.js").then((n) => n.a);
9
+ whatsAppSendModulePromise ??= import("./send-Cn2WKdPM.js").then((n) => n.a);
10
10
  return whatsAppSendModulePromise;
11
11
  }
12
12
  function normalizeOutboundText(text) {
@@ -1,6 +1,6 @@
1
- import { p as toWhatsappJid } from "./text-runtime-CMxQczvs.js";
2
- import { n as normalizeWhatsAppPayloadText, t as normalizeWhatsAppOutboundPayload } from "./outbound-media-contract-BW560jdu.js";
3
- import { i as lookupInboundMessageMetaForTarget } from "./quoted-message-BQsRXnac.js";
1
+ import { n as normalizeWhatsAppPayloadText, t as normalizeWhatsAppOutboundPayload } from "./outbound-media-contract-CQnjZqsm.js";
2
+ import { p as toWhatsappJid } from "./text-runtime-DyR0XOJ4.js";
3
+ import { i as lookupInboundMessageMetaForTarget } from "./quoted-message-C5vX90mp.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,10 +1,21 @@
1
- import { t as formatError } from "./session-errors-CSuKZPub.js";
2
- import { a as sanitizeAssistantVisibleTextWithProfile, i as sanitizeAssistantVisibleText, o as sleep, s as stripToolCallXmlTags } from "./text-runtime-CMxQczvs.js";
1
+ import { t as formatError } from "./session-errors-KYQIoX8M.js";
2
+ import { a as sanitizeAssistantVisibleTextWithProfile, i as sanitizeAssistantVisibleText, o as sleep, s as stripToolCallXmlTags } from "./text-runtime-DyR0XOJ4.js";
3
3
  import path from "node:path";
4
+ import { extensionForMime } from "openclaw/plugin-sdk/media-mime";
4
5
  import { MEDIA_FFMPEG_MAX_AUDIO_DURATION_SECS, runFfmpeg } from "openclaw/plugin-sdk/media-runtime";
5
6
  import { sanitizeForPlainText } from "openclaw/plugin-sdk/outbound-runtime";
6
7
  import { writeExternalFileWithinRoot } from "openclaw/plugin-sdk/security-runtime";
7
8
  import { resolvePreferredOpenClawTmpDir, withTempWorkspace } from "openclaw/plugin-sdk/temp-path";
9
+ //#region extensions/whatsapp/src/document-filename.ts
10
+ const WHATSAPP_DEFAULT_DOCUMENT_FILE_NAME = "file";
11
+ function resolveWhatsAppDefaultDocumentFileName(mimetype) {
12
+ const extension = extensionForMime(mimetype);
13
+ return extension ? `${WHATSAPP_DEFAULT_DOCUMENT_FILE_NAME}${extension}` : WHATSAPP_DEFAULT_DOCUMENT_FILE_NAME;
14
+ }
15
+ function resolveWhatsAppDocumentFileName(params) {
16
+ return params.fileName?.trim() || resolveWhatsAppDefaultDocumentFileName(params.mimetype);
17
+ }
18
+ //#endregion
8
19
  //#region extensions/whatsapp/src/outbound-media-contract.ts
9
20
  const WHATSAPP_VOICE_FILE_NAME = "voice.ogg";
10
21
  const WHATSAPP_VOICE_SAMPLE_RATE_HZ = 48e3;
@@ -46,7 +57,10 @@ function normalizeWhatsAppLoadedMedia(media, mediaUrl) {
46
57
  contentType: media.contentType,
47
58
  mediaUrl
48
59
  }) ? WHATSAPP_VOICE_MIMETYPE : media.contentType ?? "application/octet-stream";
49
- const fileName = kind === "document" ? media.fileName ?? deriveWhatsAppDocumentFileName(mediaUrl) ?? "file" : media.fileName;
60
+ const fileName = kind === "document" ? resolveWhatsAppDocumentFileName({
61
+ fileName: media.fileName ?? deriveWhatsAppDocumentFileName(mediaUrl),
62
+ mimetype
63
+ }) : media.fileName;
50
64
  return {
51
65
  buffer: media.buffer,
52
66
  kind,
@@ -158,4 +172,4 @@ async function sendWhatsAppOutboundWithRetry(params) {
158
172
  throw lastError;
159
173
  }
160
174
  //#endregion
161
- export { resolveWhatsAppOutboundMediaUrls as a, prepareWhatsAppOutboundMedia as i, normalizeWhatsAppPayloadText as n, sendWhatsAppOutboundWithRetry as o, normalizeWhatsAppPayloadTextPreservingIndentation as r, normalizeWhatsAppOutboundPayload as t };
175
+ export { resolveWhatsAppOutboundMediaUrls as a, prepareWhatsAppOutboundMedia as i, normalizeWhatsAppPayloadText as n, sendWhatsAppOutboundWithRetry as o, normalizeWhatsAppPayloadTextPreservingIndentation as r, resolveWhatsAppDocumentFileName as s, normalizeWhatsAppOutboundPayload as t };
@@ -1,2 +1,2 @@
1
- import { t as whatsappOutbound } from "./outbound-adapter-C0p1kFXz.js";
1
+ import { t as whatsappOutbound } from "./outbound-adapter-pW4J6iz-.js";
2
2
  export { whatsappOutbound };
@@ -1,4 +1,4 @@
1
- import { u as jidToE164 } from "./text-runtime-CMxQczvs.js";
1
+ import { u as jidToE164 } from "./text-runtime-DyR0XOJ4.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,16 +1,16 @@
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-fgfdJlPZ.js";
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-CByjzdb_.js";
2
+ import { n as whatsAppActionRuntime, t as handleWhatsAppAction } from "./action-runtime-CnXRJ7y1.js";
3
+ import { n as getStatusCode, t as formatError } from "./session-errors-KYQIoX8M.js";
4
+ import { i as sendTypingWhatsApp, n as sendPollWhatsApp, r as sendReactionWhatsApp, t as sendMessageWhatsApp } from "./send-Cn2WKdPM.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-Cr3tg0Jm.js";
8
+ import { C as waitForCredsSaveQueue, T as writeCredsJsonAtomically, _ as readWebSelfIdentity, a as formatWhatsAppWebAuthStatusState, b as restoreCredsFromBackupIfNeeded, c as logoutWeb, d as readWebAuthExistsBestEffort, f as readWebAuthExistsForDecision, g as readWebSelfId, h as readWebAuthState, l as pickWebChannel, m as readWebAuthSnapshotBestEffort, n as WHATSAPP_AUTH_UNSTABLE_CODE, o as getWebAuthAgeMs, p as readWebAuthSnapshot, r as WhatsAppAuthUnstableError, s as logWebSelfId, t as WA_WEB_AUTH_DIR, u as readCredsJsonRaw, v as readWebSelfIdentityForDecision, w as waitForCredsSaveQueueWithTimeout, x as webAuthExists, y as resolveDefaultWebAuthDir } from "./auth-store-wR_4v9Z0.js";
9
9
  import { t as DEFAULT_WEB_MEDIA_BYTES } from "./constants-yKXGCGU9.js";
10
- import { c as extractContactContext, d as extractMediaPlaceholder, p as extractText, u as extractLocationData } from "./send-api-BNbwVO4e.js";
11
- import { n as newConnectionId, r as waitForWaConnection, t as createWaSocket } from "./session-B4Rnsd-V.js";
12
- import { n as resolveWebAccountId, t as getActiveWebListener } from "./active-listener-D2NHQ5Og.js";
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 "./monitor-D4UnxxWO.js";
14
- import { t as loginWeb } from "./login-CxQb0cqz.js";
10
+ import { c as extractContactContext, d as extractMediaPlaceholder, p as extractText, u as extractLocationData } from "./send-api-CwheV1Iq.js";
11
+ import { n as newConnectionId, r as waitForWaConnection, t as createWaSocket } from "./session-CQXMIgyz.js";
12
+ import { n as resolveWebAccountId, t as getActiveWebListener } from "./active-listener-C4ClVut4.js";
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 "./monitor-0P4gS6Tw.js";
14
+ import { t as loginWeb } from "./login-B30t_ENM.js";
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, 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 };
@@ -1,11 +1,11 @@
1
1
  import { t as __exportAll } from "./rolldown-runtime-CiIaOW0V.js";
2
- import { r as resolveDefaultWhatsAppAccountId } from "./account-ids-DG18xddX.js";
3
- import { a as resolveWhatsAppAccount, s as resolveWhatsAppMediaMaxBytes } from "./accounts-B4oR6Dhx.js";
2
+ import { r as resolveDefaultWhatsAppAccountId } from "./account-ids-DgtV_RiP.js";
3
+ import { a as resolveWhatsAppAccount, s as resolveWhatsAppMediaMaxBytes } from "./accounts-Dn7MUPTZ.js";
4
4
  import { n as isWhatsAppNewsletterJid } from "./normalize-target-MB6Z_4Bn.js";
5
5
  import { t as getRegisteredWhatsAppConnectionController } from "./connection-controller-registry-D_iIGz5m.js";
6
- import "./normalize-BZBRXai6.js";
7
- import { d as markdownToWhatsApp, p as toWhatsappJid } from "./text-runtime-CMxQczvs.js";
8
- import { a as resolveWhatsAppOutboundMediaUrls, i as prepareWhatsAppOutboundMedia, n as normalizeWhatsAppPayloadText } from "./outbound-media-contract-BW560jdu.js";
6
+ import { a as resolveWhatsAppOutboundMediaUrls, i as prepareWhatsAppOutboundMedia, n as normalizeWhatsAppPayloadText, s as resolveWhatsAppDocumentFileName } from "./outbound-media-contract-CQnjZqsm.js";
7
+ import "./normalize-LMXvL6w0.js";
8
+ import { d as markdownToWhatsApp, p as toWhatsappJid } from "./text-runtime-DyR0XOJ4.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";
@@ -116,7 +116,10 @@ async function sendMessageWhatsApp(to, body, options) {
116
116
  text = caption ?? "";
117
117
  documentFileName = media.fileName;
118
118
  } else text = caption ?? "";
119
- if (forceDocumentDelivery) documentFileName ??= media.fileName ?? "file";
119
+ if (forceDocumentDelivery) documentFileName ??= resolveWhatsAppDocumentFileName({
120
+ fileName: media.fileName,
121
+ mimetype: media.mimetype
122
+ });
120
123
  }
121
124
  outboundLog.info(`Sending message -> ${redactedJid}${primaryMediaUrl ? " (media)" : ""}`);
122
125
  logger.info({
@@ -1,8 +1,9 @@
1
1
  import { n as isWhatsAppNewsletterJid } from "./normalize-target-MB6Z_4Bn.js";
2
- import "./normalize-BZBRXai6.js";
3
- import { m as toWhatsappJidWithLid, p as toWhatsappJid, u as jidToE164 } from "./text-runtime-CMxQczvs.js";
4
- import { t as buildQuotedMessageOptions } from "./quoted-message-BQsRXnac.js";
5
- import { c as resolveComparableIdentity } from "./identity-BNDkpR8N.js";
2
+ import { s as resolveWhatsAppDocumentFileName } from "./outbound-media-contract-CQnjZqsm.js";
3
+ import "./normalize-LMXvL6w0.js";
4
+ import { m as toWhatsappJidWithLid, p as toWhatsappJid, u as jidToE164 } from "./text-runtime-DyR0XOJ4.js";
5
+ import { t as buildQuotedMessageOptions } from "./quoted-message-C5vX90mp.js";
6
+ import { c as resolveComparableIdentity } from "./identity-CVFJuB0Q.js";
6
7
  import { normalizeLowercaseStringOrEmpty } from "openclaw/plugin-sdk/string-coerce-runtime";
7
8
  import { logVerbose } from "openclaw/plugin-sdk/runtime-env";
8
9
  import { createMessageReceiptFromOutboundResults, listMessageReceiptPlatformIds } from "openclaw/plugin-sdk/channel-message";
@@ -626,7 +627,10 @@ function createWebSendApi(params) {
626
627
  } : await resolveMentions(jid, text);
627
628
  if (mediaBuffer && mediaType) if (sendOptions?.asDocument === true && supportsForcedDocumentMediaType(mediaType)) payload = {
628
629
  document: mediaBuffer,
629
- fileName: sendOptions?.fileName?.trim() || "file",
630
+ fileName: resolveWhatsAppDocumentFileName({
631
+ fileName: sendOptions?.fileName,
632
+ mimetype: mediaType
633
+ }),
630
634
  caption: resolvedPayloadText.text || void 0,
631
635
  mimetype: mediaType
632
636
  };
@@ -650,7 +654,10 @@ function createWebSendApi(params) {
650
654
  };
651
655
  } else payload = {
652
656
  document: mediaBuffer,
653
- fileName: sendOptions?.fileName?.trim() || "file",
657
+ fileName: resolveWhatsAppDocumentFileName({
658
+ fileName: sendOptions?.fileName,
659
+ mimetype: mediaType
660
+ }),
654
661
  caption: resolvedPayloadText.text || void 0,
655
662
  mimetype: mediaType
656
663
  };
@@ -1,6 +1,6 @@
1
1
  import { n as resolveWebCredsBackupPath, r as resolveWebCredsPath } from "./creds-files-_2V8jzQa.js";
2
- import { n as getStatusCode } from "./session-errors-CSuKZPub.js";
3
- import { C as waitForCredsSaveQueueWithTimeout, l as readCredsJsonRaw, v as resolveDefaultWebAuthDir, w as writeCredsJsonAtomically, x as enqueueCredsSave, y as restoreCredsFromBackupIfNeeded } from "./auth-store-Cr3tg0Jm.js";
2
+ import { n as getStatusCode } from "./session-errors-KYQIoX8M.js";
3
+ import { S as enqueueCredsSave, T as writeCredsJsonAtomically, b as restoreCredsFromBackupIfNeeded, u as readCredsJsonRaw, w as waitForCredsSaveQueueWithTimeout, y as resolveDefaultWebAuthDir } from "./auth-store-wR_4v9Z0.js";
4
4
  import { i as makeWASocket, n as fetchLatestBaileysVersion, o as useMultiFileAuthState, r as makeCacheableSignalKeyStore, t as DisconnectReason } from "./session.runtime-BxyATGX0.js";
5
5
  import fs from "node:fs";
6
6
  import { VERSION, formatCliCommand } from "openclaw/plugin-sdk/cli-runtime";
@@ -9,7 +9,7 @@ import { renderQrTerminal } from "openclaw/plugin-sdk/media-runtime";
9
9
  import { ensureDir, resolveUserPath } from "openclaw/plugin-sdk/text-utility-runtime";
10
10
  import { randomUUID } from "node:crypto";
11
11
  import { HttpsProxyAgent } from "https-proxy-agent";
12
- import { resolveEnvHttpProxyUrl, shouldUseEnvHttpProxyForUrl } from "openclaw/plugin-sdk/fetch-runtime";
12
+ import { createHttp1EnvHttpProxyAgent, createHttp1ProxyAgent, resolveActiveManagedProxyTlsOptions, resolveEnvHttpProxyUrl, shouldUseEnvHttpProxyForUrl } from "openclaw/plugin-sdk/fetch-runtime";
13
13
  //#region extensions/whatsapp/src/socket-timing.ts
14
14
  const DEFAULT_WHATSAPP_SOCKET_TIMING = {
15
15
  keepAliveIntervalMs: 25e3,
@@ -132,8 +132,10 @@ async function resolveEnvProxyAgent(logger) {
132
132
  if (!shouldUseEnvHttpProxyForUrl(WHATSAPP_WEBSOCKET_PROXY_TARGET)) return;
133
133
  const proxyUrl = resolveEnvHttpProxyUrl("https");
134
134
  if (!proxyUrl) return;
135
+ const proxyTls = resolveActiveManagedProxyTlsOptions({ proxyUrl });
136
+ const proxyAgentOptions = proxyTls?.ca ? { ca: proxyTls.ca } : void 0;
135
137
  try {
136
- const agent = new HttpsProxyAgent(proxyUrl);
138
+ const agent = new HttpsProxyAgent(proxyUrl, proxyAgentOptions);
137
139
  logger.info("Using ambient env proxy for WhatsApp WebSocket connection");
138
140
  return agent;
139
141
  } catch (error) {
@@ -146,11 +148,7 @@ async function resolveEnvFetchDispatcher(logger, agent) {
146
148
  const envProxyUrl = resolveEnvHttpsProxyUrl();
147
149
  if (!proxyUrl && !envProxyUrl) return;
148
150
  try {
149
- const { EnvHttpProxyAgent, ProxyAgent } = await import("undici");
150
- return proxyUrl ? new ProxyAgent({
151
- allowH2: false,
152
- uri: proxyUrl
153
- }) : new EnvHttpProxyAgent({ allowH2: false });
151
+ return proxyUrl ? createHttp1ProxyAgent({ uri: proxyUrl }) : createHttp1EnvHttpProxyAgent();
154
152
  } catch (error) {
155
153
  logger.warn({ error: String(error) }, "Failed to initialize env proxy dispatcher for WhatsApp media uploads");
156
154
  return;
@@ -1,5 +1,5 @@
1
- import { r as resolveDefaultWhatsAppAccountId, t as listAccountIds } from "./account-ids-DG18xddX.js";
2
- import { a as resolveWhatsAppAccount, n as hasAnyWhatsAppAuth } from "./accounts-B4oR6Dhx.js";
1
+ import { r as resolveDefaultWhatsAppAccountId, t as listAccountIds } from "./account-ids-DgtV_RiP.js";
2
+ import { a as resolveWhatsAppAccount, n as hasAnyWhatsAppAuth } from "./accounts-Dn7MUPTZ.js";
3
3
  import { a as normalizeWhatsAppAllowFromEntries } from "./normalize-target-MB6Z_4Bn.js";
4
4
  import { t as WhatsAppChannelConfigSchema } from "./config-schema-Dmo66Ubb.js";
5
5
  import { n as whatsappDoctor } from "./doctor-A9tXm9Om.js";
@@ -125,10 +125,10 @@ function resolveWhatsAppConfigPath(params) {
125
125
  return `${resolveWhatsAppGroupScopeBasePath(params)}.${params.field}`;
126
126
  }
127
127
  async function loadWhatsAppChannelRuntime() {
128
- return await import("./channel.runtime-BrKncUJI.js");
128
+ return await import("./channel.runtime-CrkogIac.js");
129
129
  }
130
130
  async function loadWhatsAppSetupSurface() {
131
- return await import("./setup-surface-B5pabs1e.js");
131
+ return await import("./setup-surface-BY8ECdvP.js");
132
132
  }
133
133
  const whatsappSetupWizardProxy = createWhatsAppSetupWizardProxy(async () => (await loadWhatsAppSetupSurface()).whatsappSetupWizard);
134
134
  const whatsappConfigAdapter = createScopedChannelConfigAdapter({
@@ -1,7 +1,7 @@
1
- import { r as resolveDefaultWhatsAppAccountId } from "./account-ids-DG18xddX.js";
2
- import { a as resolveWhatsAppAccount, o as resolveWhatsAppAuthDir } from "./accounts-B4oR6Dhx.js";
1
+ import { r as resolveDefaultWhatsAppAccountId } from "./account-ids-DgtV_RiP.js";
2
+ import { a as resolveWhatsAppAccount, o as resolveWhatsAppAuthDir } from "./accounts-Dn7MUPTZ.js";
3
3
  import { a as normalizeWhatsAppAllowFromEntries, o as normalizeWhatsAppAllowFromEntry } from "./normalize-target-MB6Z_4Bn.js";
4
- import { t as whatsappSetupAdapter } from "./setup-core-BFErZldJ.js";
4
+ import { t as whatsappSetupAdapter } from "./setup-core-CmeuY34a.js";
5
5
  import path from "node:path";
6
6
  import { DEFAULT_ACCOUNT_ID, createSetupTranslator, pathExists, splitSetupEntries } from "openclaw/plugin-sdk/setup";
7
7
  import { formatCliCommand, formatDocsLink } from "openclaw/plugin-sdk/setup-tools";
@@ -280,7 +280,7 @@ async function finalizeWhatsAppSetup(params) {
280
280
  message: linked ? t("wizard.whatsapp.relinkPrompt") : t("wizard.whatsapp.linkNowPrompt"),
281
281
  initialValue: !linked
282
282
  })) try {
283
- const { loginWeb } = await import("./login-CxQb0cqz.js").then((n) => n.n);
283
+ const { loginWeb } = await import("./login-B30t_ENM.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)}`);
@@ -1,2 +1,2 @@
1
- import { t as whatsappSetupPlugin } from "./channel.setup-JfQ9Dv9K.js";
1
+ import { t as whatsappSetupPlugin } from "./channel.setup-v-syzAcD.js";
2
2
  export { whatsappSetupPlugin };
@@ -1,6 +1,6 @@
1
- import { t as listAccountIds } from "./account-ids-DG18xddX.js";
2
- import { o as resolveWhatsAppAuthDir } from "./accounts-B4oR6Dhx.js";
3
- import { i as formatWhatsAppWebAuthStatusState, m as readWebAuthState } from "./auth-store-Cr3tg0Jm.js";
1
+ import { t as listAccountIds } from "./account-ids-DgtV_RiP.js";
2
+ import { o as resolveWhatsAppAuthDir } from "./accounts-Dn7MUPTZ.js";
3
+ import { a as formatWhatsAppWebAuthStatusState, h as readWebAuthState } from "./auth-store-wR_4v9Z0.js";
4
4
  import { DEFAULT_ACCOUNT_ID, createSetupTranslator, setSetupChannelEnabled } from "openclaw/plugin-sdk/setup";
5
5
  //#region extensions/whatsapp/src/setup-surface.ts
6
6
  const t = createSetupTranslator();
@@ -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-CnTB-PeX.js")).finalizeWhatsAppSetup(params),
39
+ finalize: async (params) => await (await import("./setup-finalize-Bgqs2cUL.js")).finalizeWhatsAppSetup(params),
40
40
  disable: (cfg) => setSetupChannelEnabled(cfg, channel, false),
41
41
  onAccountRecorded: (accountId, options) => {
42
42
  options?.onAccountId?.(channel, accountId);
package/dist/test-api.js CHANGED
@@ -1,3 +1,3 @@
1
1
  import { t as resolveWhatsAppRuntimeGroupPolicy } from "./runtime-group-policy-BH_U23qp.js";
2
- import { t as whatsappOutbound } from "./outbound-adapter-C0p1kFXz.js";
2
+ import { t as whatsappOutbound } from "./outbound-adapter-pW4J6iz-.js";
3
3
  export { resolveWhatsAppRuntimeGroupPolicy, whatsappOutbound };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openclaw/whatsapp",
3
- "version": "2026.5.16-beta.4",
3
+ "version": "2026.5.16-beta.6",
4
4
  "description": "OpenClaw WhatsApp channel plugin",
5
5
  "repository": {
6
6
  "type": "git",
@@ -12,15 +12,14 @@
12
12
  "baileys": "7.0.0-rc11",
13
13
  "https-proxy-agent": "9.0.0",
14
14
  "jimp": "1.6.1",
15
- "typebox": "1.1.38",
16
- "undici": "8.3.0"
15
+ "typebox": "1.1.38"
17
16
  },
18
17
  "devDependencies": {
19
18
  "@openclaw/plugin-sdk": "workspace:*",
20
19
  "openclaw": "workspace:*"
21
20
  },
22
21
  "peerDependencies": {
23
- "openclaw": ">=2026.5.16-beta.4"
22
+ "openclaw": ">=2026.5.16-beta.6"
24
23
  },
25
24
  "peerDependenciesMeta": {
26
25
  "openclaw": {
@@ -63,10 +62,10 @@
63
62
  "minHostVersion": ">=2026.4.25"
64
63
  },
65
64
  "compat": {
66
- "pluginApi": ">=2026.5.16-beta.4"
65
+ "pluginApi": ">=2026.5.16-beta.6"
67
66
  },
68
67
  "build": {
69
- "openclawVersion": "2026.5.16-beta.4"
68
+ "openclawVersion": "2026.5.16-beta.6"
70
69
  },
71
70
  "release": {
72
71
  "publishToClawHub": true,