@openclaw/whatsapp 2026.5.16-beta.3 → 2026.5.16-beta.5
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.
- package/dist/{access-control-Di_o41dj.js → access-control-CTFVk322.js} +3 -3
- package/dist/{account-ids-DG18xddX.js → account-ids-DgtV_RiP.js} +1 -1
- package/dist/{accounts-B4oR6Dhx.js → accounts-Dn7MUPTZ.js} +1 -1
- package/dist/{action-runtime-Dig47HuK.js → action-runtime-CnXRJ7y1.js} +3 -3
- package/dist/action-runtime-api.js +1 -1
- package/dist/action-runtime.runtime.js +1 -1
- package/dist/{active-listener-D2NHQ5Og.js → active-listener-C4ClVut4.js} +1 -1
- package/dist/api.js +14 -14
- package/dist/{auth-store-Cr3tg0Jm.js → auth-store-BLombDz2.js} +2 -2
- package/dist/{channel-BG0Lv4c9.js → channel-BgZVyr0b.js} +12 -12
- package/dist/channel-plugin-api.js +1 -1
- package/dist/{channel-react-action-Q1STHXmW.js → channel-react-action-UYINADWb.js} +3 -3
- package/dist/{channel.runtime-ChxB8Ns0.js → channel.runtime-CTkGaHjb.js} +5 -5
- package/dist/{channel.setup-BiyPwedi.js → channel.setup-fbt418I5.js} +2 -2
- package/dist/{connection-controller-YqKi6Ekq.js → connection-controller-BYwqsA1G.js} +3 -3
- package/dist/contract-api.js +3 -3
- package/dist/{directory-config-ClsMAYen.js → directory-config-BfyInQuH.js} +2 -2
- package/dist/directory-contract-api.js +1 -1
- package/dist/{identity-BNDkpR8N.js → identity-CVFJuB0Q.js} +1 -1
- package/dist/light-runtime-api.js +3 -3
- package/dist/{login-CxQb0cqz.js → login-DCJ2yz97.js} +4 -4
- package/dist/{login-qr-BCZXDJbM.js → login-qr-DBQPQcY5.js} +4 -4
- package/dist/login-qr-runtime.js +1 -1
- package/dist/{monitor-BVvWWOfi.js → monitor-CGZtbqcj.js} +13 -13
- package/dist/normalize-LMXvL6w0.js +2 -0
- package/dist/{normalize-target-ePanEpfY.js → normalize-target-MB6Z_4Bn.js} +10 -6
- package/dist/{outbound-adapter-QDdZXpZB.js → outbound-adapter-pW4J6iz-.js} +4 -4
- package/dist/{outbound-base-Cs2ntgBb.js → outbound-base-Dfj1SAyO.js} +5 -4
- package/dist/{outbound-media-contract-DwACmTqZ.js → outbound-media-contract-CQnjZqsm.js} +18 -4
- package/dist/outbound-payload-test-api.js +1 -1
- package/dist/{quoted-message-BQsRXnac.js → quoted-message-C5vX90mp.js} +1 -1
- package/dist/{resolve-outbound-target-BKcv4ofn.js → resolve-outbound-target-Ba7sH80H.js} +1 -1
- package/dist/runtime-api.js +9 -9
- package/dist/{send-DG5fpuQZ.js → send-Cn2WKdPM.js} +24 -9
- package/dist/{send-api-DYiQpIng.js → send-api-CwheV1Iq.js} +23 -7
- package/dist/{session-B4Rnsd-V.js → session-CNnb9q6w.js} +7 -9
- package/dist/{setup-core-B5F7F8bE.js → setup-core-pCknFclP.js} +5 -5
- package/dist/{setup-finalize-B62sUNjU.js → setup-finalize-EJDyGBTM.js} +5 -5
- package/dist/setup-plugin-api.js +1 -1
- package/dist/{setup-surface-7163OZHk.js → setup-surface-oprjdTAx.js} +4 -4
- package/dist/targets.js +1 -1
- package/dist/test-api.js +1 -1
- package/package.json +5 -6
- package/dist/normalize-f31evwm8.js +0 -2
- /package/dist/{session-errors-CSuKZPub.js → session-errors-KYQIoX8M.js} +0 -0
- /package/dist/{text-runtime-CMxQczvs.js → text-runtime-DyR0XOJ4.js} +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { a as resolveWhatsAppAccount } from "./accounts-
|
|
2
|
-
import { l as isSelfChatMode, n as normalizeE164 } from "./text-runtime-
|
|
3
|
-
import { a as getSelfIdentity, o as getSenderIdentity } from "./identity-
|
|
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-
|
|
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-
|
|
2
|
-
import { t as resolveWhatsAppOutboundTarget } from "./resolve-outbound-target-
|
|
1
|
+
import { a as resolveWhatsAppAccount } from "./accounts-Dn7MUPTZ.js";
|
|
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-
|
|
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-
|
|
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-
|
|
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-
|
|
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-
|
|
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-
|
|
3
|
-
import { a as normalizeWhatsAppAllowFromEntries, c as normalizeWhatsAppTarget, i as looksLikeWhatsAppTargetId, r as isWhatsAppUserTarget, s as normalizeWhatsAppMessagingTarget, t as isWhatsAppGroupJid } from "./normalize-target-
|
|
4
|
-
import { t as resolveWhatsAppOutboundTarget } from "./resolve-outbound-target-
|
|
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
|
+
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
|
+
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-
|
|
7
|
-
import "./send-
|
|
8
|
-
import { t as whatsappPlugin } from "./channel-
|
|
9
|
-
import { n as WHATSAPP_LEGACY_OUTBOUND_SEND_DEP_KEYS } from "./outbound-base-
|
|
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-BgZVyr0b.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-
|
|
11
|
+
import { a as resolveWhatsAppGroupRequireMention, o as resolveWhatsAppGroupToolPolicy, s as resolveWhatsAppGroupIntroHint } from "./setup-core-pCknFclP.js";
|
|
12
12
|
import "./config-schema-Dmo66Ubb.js";
|
|
13
|
-
import { t as whatsappSetupPlugin } from "./channel.setup-
|
|
13
|
+
import { t as whatsappSetupPlugin } from "./channel.setup-fbt418I5.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-
|
|
16
|
-
import { t as __testing } from "./access-control-
|
|
17
|
-
import { p as extractText, t as createWebSendApi } from "./send-api-
|
|
18
|
-
import { r as waitForWaConnection, t as createWaSocket } from "./session-
|
|
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-CNnb9q6w.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,6 @@
|
|
|
1
1
|
import { n as resolveWebCredsBackupPath, r as resolveWebCredsPath } from "./creds-files-_2V8jzQa.js";
|
|
2
|
-
import { r as resolveUserPath } from "./text-runtime-
|
|
3
|
-
import { c as resolveComparableIdentity } from "./identity-
|
|
2
|
+
import { r as resolveUserPath } from "./text-runtime-DyR0XOJ4.js";
|
|
3
|
+
import { c as resolveComparableIdentity } from "./identity-CVFJuB0Q.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";
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import { t as listAccountIds } from "./account-ids-
|
|
2
|
-
import { a as resolveWhatsAppAccount } from "./accounts-
|
|
3
|
-
import { c as normalizeWhatsAppTarget, i as looksLikeWhatsAppTargetId, n as isWhatsAppNewsletterJid, o as normalizeWhatsAppAllowFromEntry, s as normalizeWhatsAppMessagingTarget, t as isWhatsAppGroupJid } from "./normalize-target-
|
|
4
|
-
import { t as resolveWhatsAppOutboundTarget } from "./resolve-outbound-target-
|
|
1
|
+
import { t as listAccountIds } from "./account-ids-DgtV_RiP.js";
|
|
2
|
+
import { a as resolveWhatsAppAccount } from "./accounts-Dn7MUPTZ.js";
|
|
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
|
+
import { t as resolveWhatsAppOutboundTarget } from "./resolve-outbound-target-Ba7sH80H.js";
|
|
5
5
|
import { t as resolveWhatsAppReactionLevel } from "./reaction-level-2m9sWGCw.js";
|
|
6
|
-
import "./
|
|
7
|
-
import
|
|
8
|
-
import { i as sendTypingWhatsApp, n as sendPollWhatsApp, t as sendMessageWhatsApp } from "./send-
|
|
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-
|
|
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-
|
|
14
|
-
import { d as readWebAuthExistsForDecision, n as WHATSAPP_AUTH_UNSTABLE_CODE } from "./auth-store-
|
|
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-pCknFclP.js";
|
|
14
|
+
import { d as readWebAuthExistsForDecision, n as WHATSAPP_AUTH_UNSTABLE_CODE } from "./auth-store-BLombDz2.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-
|
|
325
|
-
const loadWhatsAppChannelReactAction = createLazyRuntimeModule(() => import("./channel-react-action-
|
|
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-
|
|
1
|
+
import { t as whatsappPlugin } from "./channel-BgZVyr0b.js";
|
|
2
2
|
export { whatsappPlugin };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { c as normalizeWhatsAppTarget, t as isWhatsAppGroupJid } from "./normalize-target-
|
|
2
|
-
import { t as handleWhatsAppAction } from "./action-runtime-
|
|
3
|
-
import "./normalize-
|
|
1
|
+
import { c as normalizeWhatsAppTarget, t as isWhatsAppGroupJid } from "./normalize-target-MB6Z_4Bn.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-
|
|
3
|
-
import { t as getActiveWebListener$1 } from "./active-listener-
|
|
4
|
-
import { t as monitorWebChannel$1 } from "./monitor-
|
|
5
|
-
import { t as loginWeb$1 } from "./login-
|
|
6
|
-
import { whatsappSetupWizard as whatsappSetupWizard$1 } from "./setup-surface-
|
|
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-BLombDz2.js";
|
|
3
|
+
import { t as getActiveWebListener$1 } from "./active-listener-C4ClVut4.js";
|
|
4
|
+
import { t as monitorWebChannel$1 } from "./monitor-CGZtbqcj.js";
|
|
5
|
+
import { t as loginWeb$1 } from "./login-DCJ2yz97.js";
|
|
6
|
+
import { whatsappSetupWizard as whatsappSetupWizard$1 } from "./setup-surface-oprjdTAx.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 resolveWhatsAppGroupRequireMention, i as whatsappSetupWizardProxy, n as createWhatsAppPluginBase, o as resolveWhatsAppGroupToolPolicy, s as resolveWhatsAppGroupIntroHint, t as whatsappSetupAdapter } from "./setup-core-
|
|
2
|
-
import { m as readWebAuthState } from "./auth-store-
|
|
1
|
+
import { a as resolveWhatsAppGroupRequireMention, i as whatsappSetupWizardProxy, n as createWhatsAppPluginBase, o as resolveWhatsAppGroupToolPolicy, s as resolveWhatsAppGroupIntroHint, t as whatsappSetupAdapter } from "./setup-core-pCknFclP.js";
|
|
2
|
+
import { m as readWebAuthState } from "./auth-store-BLombDz2.js";
|
|
3
3
|
import { t as detectWhatsAppLegacyStateMigrations } from "./state-migrations-CtdIArlK.js";
|
|
4
4
|
//#region extensions/whatsapp/src/channel.setup.ts
|
|
5
5
|
const whatsappSetupPlugin = {
|
|
@@ -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-
|
|
3
|
-
import { s as logoutWeb } from "./auth-store-
|
|
4
|
-
import { r as waitForWaConnection, t as createWaSocket } from "./session-
|
|
2
|
+
import { n as getStatusCode, t as formatError } from "./session-errors-KYQIoX8M.js";
|
|
3
|
+
import { s as logoutWeb } from "./auth-store-BLombDz2.js";
|
|
4
|
+
import { r as waitForWaConnection, t as createWaSocket } from "./session-CNnb9q6w.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";
|
package/dist/contract-api.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { c as normalizeWhatsAppTarget$1, t as isWhatsAppGroupJid$1 } from "./normalize-target-
|
|
1
|
+
import { c as normalizeWhatsAppTarget$1, t as isWhatsAppGroupJid$1 } from "./normalize-target-MB6Z_4Bn.js";
|
|
2
2
|
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-
|
|
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-
|
|
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
|
-
import { c as normalizeWhatsAppTarget, t as isWhatsAppGroupJid } from "./normalize-target-
|
|
4
|
-
import "./normalize-
|
|
3
|
+
import { c as normalizeWhatsAppTarget, t as isWhatsAppGroupJid } from "./normalize-target-MB6Z_4Bn.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-
|
|
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-
|
|
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-
|
|
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-
|
|
4
|
-
import { t as getActiveWebListener } from "./active-listener-
|
|
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-BLombDz2.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-
|
|
3
|
-
import { y as restoreCredsFromBackupIfNeeded } from "./auth-store-
|
|
4
|
-
import { a as renderQrTerminal, i as resolveWhatsAppSocketTiming, t as createWaSocket } from "./session-
|
|
5
|
-
import { a as closeWaSocketSoon, o as waitForWhatsAppLoginResult } from "./connection-controller-
|
|
2
|
+
import { a as resolveWhatsAppAccount } from "./accounts-Dn7MUPTZ.js";
|
|
3
|
+
import { y as restoreCredsFromBackupIfNeeded } from "./auth-store-BLombDz2.js";
|
|
4
|
+
import { a as renderQrTerminal, i as resolveWhatsAppSocketTiming, t as createWaSocket } from "./session-CNnb9q6w.js";
|
|
5
|
+
import { a as closeWaSocketSoon, o as waitForWhatsAppLoginResult } from "./connection-controller-BYwqsA1G.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-
|
|
2
|
-
import { d as readWebAuthExistsForDecision, h as readWebSelfId, n as WHATSAPP_AUTH_UNSTABLE_CODE } from "./auth-store-
|
|
3
|
-
import { i as resolveWhatsAppSocketTiming, t as createWaSocket } from "./session-
|
|
4
|
-
import { i as closeWaSocket, o as waitForWhatsAppLoginResult, t as WHATSAPP_LOGGED_OUT_QR_MESSAGE } from "./connection-controller-
|
|
1
|
+
import { a as resolveWhatsAppAccount } from "./accounts-Dn7MUPTZ.js";
|
|
2
|
+
import { d as readWebAuthExistsForDecision, h as readWebSelfId, n as WHATSAPP_AUTH_UNSTABLE_CODE } from "./auth-store-BLombDz2.js";
|
|
3
|
+
import { i as resolveWhatsAppSocketTiming, t as createWaSocket } from "./session-CNnb9q6w.js";
|
|
4
|
+
import { i as closeWaSocket, o as waitForWhatsAppLoginResult, t as WHATSAPP_LOGGED_OUT_QR_MESSAGE } from "./connection-controller-BYwqsA1G.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";
|
package/dist/login-qr-runtime.js
CHANGED
|
@@ -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-
|
|
4
|
+
loginQrModulePromise ??= import("./login-qr-DBQPQcY5.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-
|
|
2
|
-
import { t as isWhatsAppGroupJid } from "./normalize-target-
|
|
1
|
+
import { a as resolveWhatsAppAccount, s as resolveWhatsAppMediaMaxBytes } from "./accounts-Dn7MUPTZ.js";
|
|
2
|
+
import { t as isWhatsAppGroupJid } from "./normalize-target-MB6Z_4Bn.js";
|
|
3
3
|
import { t as resolveWhatsAppReactionLevel } from "./reaction-level-2m9sWGCw.js";
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import { r as sendReactionWhatsApp } from "./send-
|
|
8
|
-
import { n as cacheInboundMessageMeta, r as lookupInboundMessageMeta, t as buildQuotedMessageOptions } from "./quoted-message-
|
|
9
|
-
import { _ as readWebSelfIdentityForDecision, a as getWebAuthAgeMs, h as readWebSelfId, r as WhatsAppAuthUnstableError, s as logoutWeb } from "./auth-store-
|
|
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-
|
|
11
|
-
import { i as resolveWhatsAppInboundPolicy, n as checkInboundAccessControl, r as resolveWhatsAppCommandAuthorized } from "./access-control-
|
|
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-
|
|
13
|
-
import { i as resolveWhatsAppSocketTiming, r as waitForWaConnection, t as createWaSocket } from "./session-
|
|
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-
|
|
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 { _ as readWebSelfIdentityForDecision, a as getWebAuthAgeMs, h as readWebSelfId, r as WhatsAppAuthUnstableError, s as logoutWeb } from "./auth-store-BLombDz2.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-CNnb9q6w.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-BYwqsA1G.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";
|
|
@@ -14,12 +14,15 @@ function stripWhatsAppTargetPrefixes(value) {
|
|
|
14
14
|
if (candidate === before) return candidate;
|
|
15
15
|
}
|
|
16
16
|
}
|
|
17
|
-
function
|
|
18
|
-
const candidate = stripWhatsAppTargetPrefixes(value);
|
|
19
|
-
if (!normalizeLowercaseStringOrEmpty(candidate).endsWith("@g.us")) return
|
|
17
|
+
function normalizeWhatsAppGroupJid(value) {
|
|
18
|
+
const candidate = stripWhatsAppTargetPrefixes(value).replace(/^group:/i, "").trim();
|
|
19
|
+
if (!normalizeLowercaseStringOrEmpty(candidate).endsWith("@g.us")) return null;
|
|
20
20
|
const localPart = candidate.slice(0, candidate.length - 5);
|
|
21
|
-
if (!localPart || localPart.includes("@")) return
|
|
22
|
-
return /^[0-9]+(-[0-9]+)*$/.test(localPart);
|
|
21
|
+
if (!localPart || localPart.includes("@")) return null;
|
|
22
|
+
return /^[0-9]+(-[0-9]+)*$/.test(localPart) ? `${localPart}@g.us` : null;
|
|
23
|
+
}
|
|
24
|
+
function isWhatsAppGroupJid(value) {
|
|
25
|
+
return normalizeWhatsAppGroupJid(value) !== null;
|
|
23
26
|
}
|
|
24
27
|
function isWhatsAppNewsletterJid(value) {
|
|
25
28
|
const candidate = stripWhatsAppTargetPrefixes(value);
|
|
@@ -41,7 +44,8 @@ function extractUserJidPhone(jid) {
|
|
|
41
44
|
function normalizeWhatsAppTarget(value) {
|
|
42
45
|
const candidate = stripWhatsAppTargetPrefixes(value);
|
|
43
46
|
if (!candidate) return null;
|
|
44
|
-
|
|
47
|
+
const groupJid = normalizeWhatsAppGroupJid(candidate);
|
|
48
|
+
if (groupJid) return groupJid;
|
|
45
49
|
if (isWhatsAppNewsletterJid(candidate)) {
|
|
46
50
|
const match = candidate.match(WHATSAPP_NEWSLETTER_JID_RE);
|
|
47
51
|
return match ? `${match[1]}@newsletter` : null;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { t as resolveWhatsAppOutboundTarget } from "./resolve-outbound-target-
|
|
2
|
-
import { n as normalizeWhatsAppPayloadText } from "./outbound-media-contract-
|
|
3
|
-
import { t as createWhatsAppOutboundBase } from "./outbound-base-
|
|
1
|
+
import { t as resolveWhatsAppOutboundTarget } from "./resolve-outbound-target-Ba7sH80H.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-
|
|
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 {
|
|
2
|
-
import {
|
|
3
|
-
import { i as lookupInboundMessageMetaForTarget } from "./quoted-message-
|
|
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";
|
|
@@ -67,7 +67,7 @@ function createWhatsAppOutboundBase({ chunker, sendMessageWhatsApp, sendPollWhat
|
|
|
67
67
|
quotedMessageKey
|
|
68
68
|
});
|
|
69
69
|
},
|
|
70
|
-
sendMedia: async ({ cfg, to, text, mediaUrl, mediaAccess, mediaLocalRoots, mediaReadFile, audioAsVoice, accountId, deps, gifPlayback, replyToId }) => {
|
|
70
|
+
sendMedia: async ({ cfg, to, text, mediaUrl, mediaAccess, mediaLocalRoots, mediaReadFile, audioAsVoice, accountId, deps, gifPlayback, forceDocument, replyToId }) => {
|
|
71
71
|
const send = resolveOutboundSendDep(deps, "whatsapp", { legacyKeys: WHATSAPP_LEGACY_OUTBOUND_SEND_DEP_KEYS }) ?? sendMessageWhatsApp;
|
|
72
72
|
const quotedMessageKey = resolveQuotedMessageKey({
|
|
73
73
|
accountId: resolveQuoteLookupAccountId(cfg, accountId),
|
|
@@ -84,6 +84,7 @@ function createWhatsAppOutboundBase({ chunker, sendMessageWhatsApp, sendPollWhat
|
|
|
84
84
|
...audioAsVoice === void 0 ? {} : { audioAsVoice },
|
|
85
85
|
accountId: accountId ?? void 0,
|
|
86
86
|
gifPlayback,
|
|
87
|
+
forceDocument,
|
|
87
88
|
quotedMessageKey
|
|
88
89
|
});
|
|
89
90
|
},
|
|
@@ -1,10 +1,21 @@
|
|
|
1
|
-
import { t as formatError } from "./session-errors-
|
|
2
|
-
import { a as sanitizeAssistantVisibleTextWithProfile, i as sanitizeAssistantVisibleText, o as sleep, s as stripToolCallXmlTags } from "./text-runtime-
|
|
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" ?
|
|
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-
|
|
1
|
+
import { t as whatsappOutbound } from "./outbound-adapter-pW4J6iz-.js";
|
|
2
2
|
export { whatsappOutbound };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { c as normalizeWhatsAppTarget, n as isWhatsAppNewsletterJid, t as isWhatsAppGroupJid } from "./normalize-target-
|
|
1
|
+
import { c as normalizeWhatsAppTarget, n as isWhatsAppNewsletterJid, t as isWhatsAppGroupJid } from "./normalize-target-MB6Z_4Bn.js";
|
|
2
2
|
import { missingTargetError } from "openclaw/plugin-sdk/channel-feedback";
|
|
3
3
|
//#region extensions/whatsapp/src/resolve-outbound-target.ts
|
|
4
4
|
function whatsappAllowFromPolicyError(target) {
|
package/dist/runtime-api.js
CHANGED
|
@@ -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-
|
|
3
|
-
import { n as getStatusCode, t as formatError } from "./session-errors-
|
|
4
|
-
import { i as sendTypingWhatsApp, n as sendPollWhatsApp, r as sendReactionWhatsApp, t as sendMessageWhatsApp } from "./send-
|
|
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-
|
|
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-BLombDz2.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-
|
|
11
|
-
import { n as newConnectionId, r as waitForWaConnection, t as createWaSocket } from "./session-
|
|
12
|
-
import { n as resolveWebAccountId, t as getActiveWebListener } from "./active-listener-
|
|
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-
|
|
14
|
-
import { t as loginWeb } from "./login-
|
|
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-CNnb9q6w.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-CGZtbqcj.js";
|
|
14
|
+
import { t as loginWeb } from "./login-DCJ2yz97.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-
|
|
3
|
-
import { a as resolveWhatsAppAccount, s as resolveWhatsAppMediaMaxBytes } from "./accounts-
|
|
4
|
-
import { n as isWhatsAppNewsletterJid } from "./normalize-target-
|
|
2
|
+
import { r as resolveDefaultWhatsAppAccountId } from "./account-ids-DgtV_RiP.js";
|
|
3
|
+
import { a as resolveWhatsAppAccount, s as resolveWhatsAppMediaMaxBytes } from "./accounts-Dn7MUPTZ.js";
|
|
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 "./
|
|
7
|
-
import
|
|
8
|
-
import {
|
|
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";
|
|
@@ -18,13 +18,17 @@ import { loadWebMedia } from "openclaw/plugin-sdk/web-media";
|
|
|
18
18
|
async function loadOutboundMediaFromUrl(mediaUrl, options = {}) {
|
|
19
19
|
const readFile = options.mediaAccess?.readFile ?? options.mediaReadFile;
|
|
20
20
|
const localRoots = options.mediaAccess?.localRoots?.length && options.mediaAccess.localRoots.length > 0 ? options.mediaAccess.localRoots : options.mediaLocalRoots && options.mediaLocalRoots.length > 0 ? options.mediaLocalRoots : void 0;
|
|
21
|
-
|
|
21
|
+
const sharedOptions = {
|
|
22
22
|
...options.maxBytes !== void 0 ? { maxBytes: options.maxBytes } : {},
|
|
23
|
+
...options.optimizeImages !== void 0 ? { optimizeImages: options.optimizeImages } : {}
|
|
24
|
+
};
|
|
25
|
+
return await loadWebMedia(mediaUrl, readFile ? {
|
|
26
|
+
...sharedOptions,
|
|
23
27
|
localRoots: "any",
|
|
24
28
|
readFile,
|
|
25
29
|
hostReadCapability: true
|
|
26
30
|
} : {
|
|
27
|
-
...
|
|
31
|
+
...sharedOptions,
|
|
28
32
|
...localRoots ? { localRoots } : {}
|
|
29
33
|
});
|
|
30
34
|
}
|
|
@@ -37,6 +41,9 @@ var send_exports = /* @__PURE__ */ __exportAll({
|
|
|
37
41
|
sendTypingWhatsApp: () => sendTypingWhatsApp
|
|
38
42
|
});
|
|
39
43
|
const outboundLog = createSubsystemLogger("gateway/channels/whatsapp").child("outbound");
|
|
44
|
+
function supportsForcedDocumentDelivery(kind) {
|
|
45
|
+
return kind === "image" || kind === "video";
|
|
46
|
+
}
|
|
40
47
|
function resolveOutboundWhatsAppAccountId(params) {
|
|
41
48
|
const explicitAccountId = params.accountId?.trim();
|
|
42
49
|
if (explicitAccountId) return explicitAccountId;
|
|
@@ -89,9 +96,11 @@ async function sendMessageWhatsApp(to, body, options) {
|
|
|
89
96
|
let mediaType;
|
|
90
97
|
let documentFileName;
|
|
91
98
|
let visibleTextAfterVoice;
|
|
99
|
+
let forceDocumentDelivery = false;
|
|
92
100
|
if (primaryMediaUrl) {
|
|
93
101
|
const media = await prepareWhatsAppOutboundMedia(await loadOutboundMediaFromUrl(primaryMediaUrl, {
|
|
94
102
|
maxBytes: resolveWhatsAppMediaMaxBytes(account),
|
|
103
|
+
optimizeImages: options.forceDocument ? false : void 0,
|
|
95
104
|
mediaAccess: options.mediaAccess,
|
|
96
105
|
mediaLocalRoots: options.mediaLocalRoots,
|
|
97
106
|
mediaReadFile: options.mediaReadFile
|
|
@@ -99,6 +108,7 @@ async function sendMessageWhatsApp(to, body, options) {
|
|
|
99
108
|
const caption = text || void 0;
|
|
100
109
|
mediaBuffer = media.buffer;
|
|
101
110
|
mediaType = media.mimetype;
|
|
111
|
+
forceDocumentDelivery = Boolean(options.forceDocument && supportsForcedDocumentDelivery(media.kind));
|
|
102
112
|
if (media.kind === "audio" && caption) {
|
|
103
113
|
visibleTextAfterVoice = caption;
|
|
104
114
|
text = "";
|
|
@@ -106,6 +116,10 @@ async function sendMessageWhatsApp(to, body, options) {
|
|
|
106
116
|
text = caption ?? "";
|
|
107
117
|
documentFileName = media.fileName;
|
|
108
118
|
} else text = caption ?? "";
|
|
119
|
+
if (forceDocumentDelivery) documentFileName ??= resolveWhatsAppDocumentFileName({
|
|
120
|
+
fileName: media.fileName,
|
|
121
|
+
mimetype: media.mimetype
|
|
122
|
+
});
|
|
109
123
|
}
|
|
110
124
|
outboundLog.info(`Sending message -> ${redactedJid}${primaryMediaUrl ? " (media)" : ""}`);
|
|
111
125
|
logger.info({
|
|
@@ -114,8 +128,9 @@ async function sendMessageWhatsApp(to, body, options) {
|
|
|
114
128
|
}, "sending message");
|
|
115
129
|
if (!isWhatsAppNewsletterJid(jid)) await active.sendComposingTo(to);
|
|
116
130
|
const accountId = Boolean(options.accountId?.trim()) ? resolvedAccountId : void 0;
|
|
117
|
-
const sendOptions = options.gifPlayback || accountId || documentFileName || options.quotedMessageKey ? {
|
|
131
|
+
const sendOptions = options.gifPlayback || forceDocumentDelivery || accountId || documentFileName || options.quotedMessageKey ? {
|
|
118
132
|
...options.gifPlayback ? { gifPlayback: true } : {},
|
|
133
|
+
...forceDocumentDelivery ? { asDocument: true } : {},
|
|
119
134
|
...documentFileName ? { fileName: documentFileName } : {},
|
|
120
135
|
...options.quotedMessageKey ? { quotedMessageKey: options.quotedMessageKey } : {},
|
|
121
136
|
accountId
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import { n as isWhatsAppNewsletterJid } from "./normalize-target-
|
|
2
|
-
import "./
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
1
|
+
import { n as isWhatsAppNewsletterJid } from "./normalize-target-MB6Z_4Bn.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";
|
|
@@ -602,6 +603,9 @@ function recordWhatsAppOutbound(accountId) {
|
|
|
602
603
|
direction: "outbound"
|
|
603
604
|
});
|
|
604
605
|
}
|
|
606
|
+
function supportsForcedDocumentMediaType(mediaType) {
|
|
607
|
+
return mediaType.startsWith("image/") || mediaType.startsWith("video/");
|
|
608
|
+
}
|
|
605
609
|
function createWebSendApi(params) {
|
|
606
610
|
const resolveOutboundJid = (recipient) => params.authDir ? toWhatsappJidWithLid(recipient, { authDir: params.authDir }) : toWhatsappJid(recipient);
|
|
607
611
|
const resolveMentions = async (jid, text) => params.resolveOutboundMentions ? await params.resolveOutboundMentions({
|
|
@@ -621,7 +625,16 @@ function createWebSendApi(params) {
|
|
|
621
625
|
text,
|
|
622
626
|
mentionedJids: []
|
|
623
627
|
} : await resolveMentions(jid, text);
|
|
624
|
-
if (mediaBuffer && mediaType) if (mediaType
|
|
628
|
+
if (mediaBuffer && mediaType) if (sendOptions?.asDocument === true && supportsForcedDocumentMediaType(mediaType)) payload = {
|
|
629
|
+
document: mediaBuffer,
|
|
630
|
+
fileName: resolveWhatsAppDocumentFileName({
|
|
631
|
+
fileName: sendOptions?.fileName,
|
|
632
|
+
mimetype: mediaType
|
|
633
|
+
}),
|
|
634
|
+
caption: resolvedPayloadText.text || void 0,
|
|
635
|
+
mimetype: mediaType
|
|
636
|
+
};
|
|
637
|
+
else if (mediaType.startsWith("image/")) payload = {
|
|
625
638
|
image: mediaBuffer,
|
|
626
639
|
caption: resolvedPayloadText.text || void 0,
|
|
627
640
|
mimetype: mediaType
|
|
@@ -641,7 +654,10 @@ function createWebSendApi(params) {
|
|
|
641
654
|
};
|
|
642
655
|
} else payload = {
|
|
643
656
|
document: mediaBuffer,
|
|
644
|
-
fileName:
|
|
657
|
+
fileName: resolveWhatsAppDocumentFileName({
|
|
658
|
+
fileName: sendOptions?.fileName,
|
|
659
|
+
mimetype: mediaType
|
|
660
|
+
}),
|
|
645
661
|
caption: resolvedPayloadText.text || void 0,
|
|
646
662
|
mimetype: mediaType
|
|
647
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-
|
|
3
|
-
import { C as waitForCredsSaveQueueWithTimeout, l as readCredsJsonRaw, v as resolveDefaultWebAuthDir, w as writeCredsJsonAtomically, x as enqueueCredsSave, y as restoreCredsFromBackupIfNeeded } from "./auth-store-
|
|
2
|
+
import { n as getStatusCode } from "./session-errors-KYQIoX8M.js";
|
|
3
|
+
import { C as waitForCredsSaveQueueWithTimeout, l as readCredsJsonRaw, v as resolveDefaultWebAuthDir, w as writeCredsJsonAtomically, x as enqueueCredsSave, y as restoreCredsFromBackupIfNeeded } from "./auth-store-BLombDz2.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
|
-
|
|
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,6 +1,6 @@
|
|
|
1
|
-
import { r as resolveDefaultWhatsAppAccountId, t as listAccountIds } from "./account-ids-
|
|
2
|
-
import { a as resolveWhatsAppAccount, n as hasAnyWhatsAppAuth } from "./accounts-
|
|
3
|
-
import { a as normalizeWhatsAppAllowFromEntries } from "./normalize-target-
|
|
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
|
+
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";
|
|
6
6
|
import { t as resolveLegacyGroupSessionKey } from "./group-session-contract-DdqigLJl.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-
|
|
128
|
+
return await import("./channel.runtime-CTkGaHjb.js");
|
|
129
129
|
}
|
|
130
130
|
async function loadWhatsAppSetupSurface() {
|
|
131
|
-
return await import("./setup-surface-
|
|
131
|
+
return await import("./setup-surface-oprjdTAx.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-
|
|
2
|
-
import { a as resolveWhatsAppAccount, o as resolveWhatsAppAuthDir } from "./accounts-
|
|
3
|
-
import { a as normalizeWhatsAppAllowFromEntries, o as normalizeWhatsAppAllowFromEntry } from "./normalize-target-
|
|
4
|
-
import { t as whatsappSetupAdapter } from "./setup-core-
|
|
1
|
+
import { r as resolveDefaultWhatsAppAccountId } from "./account-ids-DgtV_RiP.js";
|
|
2
|
+
import { a as resolveWhatsAppAccount, o as resolveWhatsAppAuthDir } from "./accounts-Dn7MUPTZ.js";
|
|
3
|
+
import { a as normalizeWhatsAppAllowFromEntries, o as normalizeWhatsAppAllowFromEntry } from "./normalize-target-MB6Z_4Bn.js";
|
|
4
|
+
import { t as whatsappSetupAdapter } from "./setup-core-pCknFclP.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-
|
|
283
|
+
const { loginWeb } = await import("./login-DCJ2yz97.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)}`);
|
package/dist/setup-plugin-api.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as whatsappSetupPlugin } from "./channel.setup-
|
|
1
|
+
import { t as whatsappSetupPlugin } from "./channel.setup-fbt418I5.js";
|
|
2
2
|
export { whatsappSetupPlugin };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { t as listAccountIds } from "./account-ids-
|
|
2
|
-
import { o as resolveWhatsAppAuthDir } from "./accounts-
|
|
3
|
-
import { i as formatWhatsAppWebAuthStatusState, m as readWebAuthState } from "./auth-store-
|
|
1
|
+
import { t as listAccountIds } from "./account-ids-DgtV_RiP.js";
|
|
2
|
+
import { o as resolveWhatsAppAuthDir } from "./accounts-Dn7MUPTZ.js";
|
|
3
|
+
import { i as formatWhatsAppWebAuthStatusState, m as readWebAuthState } from "./auth-store-BLombDz2.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-
|
|
39
|
+
finalize: async (params) => await (await import("./setup-finalize-EJDyGBTM.js")).finalizeWhatsAppSetup(params),
|
|
40
40
|
disable: (cfg) => setSetupChannelEnabled(cfg, channel, false),
|
|
41
41
|
onAccountRecorded: (accountId, options) => {
|
|
42
42
|
options?.onAccountId?.(channel, accountId);
|
package/dist/targets.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { c as normalizeWhatsAppTarget, r as isWhatsAppUserTarget, t as isWhatsAppGroupJid } from "./normalize-target-
|
|
1
|
+
import { c as normalizeWhatsAppTarget, r as isWhatsAppUserTarget, t as isWhatsAppGroupJid } from "./normalize-target-MB6Z_4Bn.js";
|
|
2
2
|
export { isWhatsAppGroupJid, isWhatsAppUserTarget, normalizeWhatsAppTarget };
|
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-
|
|
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.
|
|
3
|
+
"version": "2026.5.16-beta.5",
|
|
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.
|
|
22
|
+
"openclaw": ">=2026.5.16-beta.5"
|
|
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.
|
|
65
|
+
"pluginApi": ">=2026.5.16-beta.5"
|
|
67
66
|
},
|
|
68
67
|
"build": {
|
|
69
|
-
"openclawVersion": "2026.5.16-beta.
|
|
68
|
+
"openclawVersion": "2026.5.16-beta.5"
|
|
70
69
|
},
|
|
71
70
|
"release": {
|
|
72
71
|
"publishToClawHub": true,
|
|
File without changes
|
|
File without changes
|