@openclaw/whatsapp 2026.5.14-beta.2 → 2026.5.16-beta.2
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/{action-runtime-lppOTCTN.js → action-runtime-Dig47HuK.js} +1 -1
- package/dist/action-runtime-api.js +1 -1
- package/dist/action-runtime.runtime.js +1 -1
- package/dist/api.js +6 -6
- package/dist/{auth-store-DpwdTmoO.js → auth-store-Cr3tg0Jm.js} +1 -1
- package/dist/{channel-By9xwZ6O.js → channel-BG0Lv4c9.js} +6 -6
- package/dist/channel-plugin-api.js +1 -1
- package/dist/{channel-react-action-DakXTHIg.js → channel-react-action-Q1STHXmW.js} +1 -1
- package/dist/{channel.runtime-DfdgaaVG.js → channel.runtime-ChxB8Ns0.js} +4 -4
- package/dist/{channel.setup-D6lbUvfP.js → channel.setup-BiyPwedi.js} +2 -2
- package/dist/{connection-controller-DVOzuzJk.js → connection-controller-YqKi6Ekq.js} +2 -2
- package/dist/light-runtime-api.js +1 -1
- package/dist/{login-Du1MplXB.js → login-CxQb0cqz.js} +3 -3
- package/dist/{login-qr-Bfsxe1bh.js → login-qr-BCZXDJbM.js} +3 -3
- package/dist/login-qr-runtime.js +1 -1
- package/dist/{monitor-Cd30Pnkz.js → monitor-BVvWWOfi.js} +16 -13
- package/dist/{outbound-adapter-B8fD5esZ.js → outbound-adapter-QDdZXpZB.js} +3 -3
- package/dist/{outbound-base-BgtywpNm.js → outbound-base-Cs2ntgBb.js} +1 -1
- package/dist/{outbound-media-contract-zq9aNgT8.js → outbound-media-contract-DwACmTqZ.js} +2 -0
- package/dist/outbound-payload-test-api.js +1 -1
- package/dist/runtime-api.js +6 -6
- package/dist/{send-DBfXQDd4.js → send-DG5fpuQZ.js} +1 -1
- package/dist/{session-lrTa-USS.js → session-B4Rnsd-V.js} +1 -1
- package/dist/{setup-core-CraEyjEG.js → setup-core-B5F7F8bE.js} +4 -4
- package/dist/{setup-finalize-DTWoYzBv.js → setup-finalize-B62sUNjU.js} +37 -36
- package/dist/setup-plugin-api.js +1 -1
- package/dist/{setup-surface-BW2z_2Oc.js → setup-surface-7163OZHk.js} +8 -7
- package/dist/test-api.js +1 -1
- package/package.json +4 -4
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { a as resolveWhatsAppAccount } from "./accounts-B4oR6Dhx.js";
|
|
2
2
|
import { t as resolveWhatsAppOutboundTarget } from "./resolve-outbound-target-BKcv4ofn.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-DG5fpuQZ.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-Dig47HuK.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-Dig47HuK.js";
|
|
2
2
|
export { handleWhatsAppAction };
|
package/dist/api.js
CHANGED
|
@@ -4,18 +4,18 @@ import { a as normalizeWhatsAppAllowFromEntries, c as normalizeWhatsAppTarget, i
|
|
|
4
4
|
import { t as resolveWhatsAppOutboundTarget } from "./resolve-outbound-target-BKcv4ofn.js";
|
|
5
5
|
import "./reaction-level-2m9sWGCw.js";
|
|
6
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-
|
|
8
|
-
import { t as whatsappPlugin } from "./channel-
|
|
9
|
-
import { n as WHATSAPP_LEGACY_OUTBOUND_SEND_DEP_KEYS } from "./outbound-base-
|
|
7
|
+
import "./send-DG5fpuQZ.js";
|
|
8
|
+
import { t as whatsappPlugin } from "./channel-BG0Lv4c9.js";
|
|
9
|
+
import { n as WHATSAPP_LEGACY_OUTBOUND_SEND_DEP_KEYS } from "./outbound-base-Cs2ntgBb.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-B5F7F8bE.js";
|
|
12
12
|
import "./config-schema-Dmo66Ubb.js";
|
|
13
|
-
import { t as whatsappSetupPlugin } from "./channel.setup-
|
|
13
|
+
import { t as whatsappSetupPlugin } from "./channel.setup-BiyPwedi.js";
|
|
14
14
|
import { t as DEFAULT_WEB_MEDIA_BYTES } from "./constants-yKXGCGU9.js";
|
|
15
15
|
import { n as listWhatsAppDirectoryGroupsFromConfig, r as listWhatsAppDirectoryPeersFromConfig } from "./directory-config-ClsMAYen.js";
|
|
16
16
|
import { t as __testing } from "./access-control-Di_o41dj.js";
|
|
17
17
|
import { p as extractText, t as createWebSendApi } from "./send-api-DYiQpIng.js";
|
|
18
|
-
import { r as waitForWaConnection, t as createWaSocket } from "./session-
|
|
18
|
+
import { r as waitForWaConnection, t as createWaSocket } from "./session-B4Rnsd-V.js";
|
|
19
19
|
import "openclaw/plugin-sdk/channel-actions";
|
|
20
20
|
import "openclaw/plugin-sdk/account-resolution";
|
|
21
21
|
import "openclaw/plugin-sdk/core";
|
|
@@ -336,7 +336,7 @@ async function readWebSelfIdentityForDecision(authDir = resolveDefaultWebAuthDir
|
|
|
336
336
|
function getWebAuthAgeMs(authDir = resolveDefaultWebAuthDir()) {
|
|
337
337
|
try {
|
|
338
338
|
const stats = fs.statSync(resolveWebCredsPath(resolveUserPath(authDir)));
|
|
339
|
-
return Date.now() - stats.mtimeMs;
|
|
339
|
+
return Math.max(0, Date.now() - stats.mtimeMs);
|
|
340
340
|
} catch {
|
|
341
341
|
return null;
|
|
342
342
|
}
|
|
@@ -4,14 +4,14 @@ import { c as normalizeWhatsAppTarget, i as looksLikeWhatsAppTargetId, n as isWh
|
|
|
4
4
|
import { t as resolveWhatsAppOutboundTarget } from "./resolve-outbound-target-BKcv4ofn.js";
|
|
5
5
|
import { t as resolveWhatsAppReactionLevel } from "./reaction-level-2m9sWGCw.js";
|
|
6
6
|
import "./normalize-f31evwm8.js";
|
|
7
|
-
import { r as normalizeWhatsAppPayloadTextPreservingIndentation } from "./outbound-media-contract-
|
|
8
|
-
import { i as sendTypingWhatsApp, n as sendPollWhatsApp, t as sendMessageWhatsApp } from "./send-
|
|
7
|
+
import { r as normalizeWhatsAppPayloadTextPreservingIndentation } from "./outbound-media-contract-DwACmTqZ.js";
|
|
8
|
+
import { i as sendTypingWhatsApp, n as sendPollWhatsApp, t as sendMessageWhatsApp } from "./send-DG5fpuQZ.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-Cs2ntgBb.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-B5F7F8bE.js";
|
|
14
|
+
import { d as readWebAuthExistsForDecision, n as WHATSAPP_AUTH_UNSTABLE_CODE } from "./auth-store-Cr3tg0Jm.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";
|
|
@@ -322,7 +322,7 @@ function collectWhatsAppStatusIssues(accounts) {
|
|
|
322
322
|
//#endregion
|
|
323
323
|
//#region extensions/whatsapp/src/channel.ts
|
|
324
324
|
const loadWhatsAppDirectoryConfig = createLazyRuntimeModule(() => import("./directory-config-ClsMAYen.js").then((n) => n.t));
|
|
325
|
-
const loadWhatsAppChannelReactAction = createLazyRuntimeModule(() => import("./channel-react-action-
|
|
325
|
+
const loadWhatsAppChannelReactAction = createLazyRuntimeModule(() => import("./channel-react-action-Q1STHXmW.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-BG0Lv4c9.js";
|
|
2
2
|
export { whatsappPlugin };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { c as normalizeWhatsAppTarget, t as isWhatsAppGroupJid } from "./normalize-target-ePanEpfY.js";
|
|
2
|
-
import { t as handleWhatsAppAction } from "./action-runtime-
|
|
2
|
+
import { t as handleWhatsAppAction } from "./action-runtime-Dig47HuK.js";
|
|
3
3
|
import "./normalize-f31evwm8.js";
|
|
4
4
|
import { readStringOrNumberParam, readStringParam as readStringParam$1, resolveReactionMessageId } from "openclaw/plugin-sdk/channel-actions";
|
|
5
5
|
//#region extensions/whatsapp/src/channel-react-action.ts
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { startWebLoginWithQr as startWebLoginWithQr$1, waitForWebLogin as waitForWebLogin$1 } from "./login-qr-runtime.js";
|
|
2
|
-
import { a as getWebAuthAgeMs$1, b as webAuthExists$1, d as readWebAuthExistsForDecision$1, f as readWebAuthSnapshot$1, h as readWebSelfId$1, m as readWebAuthState$1, o as logWebSelfId$1, p as readWebAuthSnapshotBestEffort$1, s as logoutWeb$1, u as readWebAuthExistsBestEffort$1 } from "./auth-store-
|
|
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
3
|
import { t as getActiveWebListener$1 } from "./active-listener-D2NHQ5Og.js";
|
|
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-
|
|
4
|
+
import { t as monitorWebChannel$1 } from "./monitor-BVvWWOfi.js";
|
|
5
|
+
import { t as loginWeb$1 } from "./login-CxQb0cqz.js";
|
|
6
|
+
import { whatsappSetupWizard as whatsappSetupWizard$1 } from "./setup-surface-7163OZHk.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-B5F7F8bE.js";
|
|
2
|
+
import { m as readWebAuthState } from "./auth-store-Cr3tg0Jm.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
2
|
import { n as getStatusCode, t as formatError } from "./session-errors-CSuKZPub.js";
|
|
3
|
-
import { s as logoutWeb } from "./auth-store-
|
|
4
|
-
import { r as waitForWaConnection, t as createWaSocket } from "./session-
|
|
3
|
+
import { s as logoutWeb } from "./auth-store-Cr3tg0Jm.js";
|
|
4
|
+
import { r as waitForWaConnection, t as createWaSocket } from "./session-B4Rnsd-V.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";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { n as getStatusCode, t as formatError } from "./session-errors-CSuKZPub.js";
|
|
2
2
|
import { t as createWhatsAppLoginTool } from "./agent-tools-login-DpRxLNRB.js";
|
|
3
|
-
import { a as getWebAuthAgeMs, b as webAuthExists, c as pickWebChannel, h as readWebSelfId, o as logWebSelfId, s as logoutWeb, t as WA_WEB_AUTH_DIR } from "./auth-store-
|
|
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
4
|
import { t as getActiveWebListener } from "./active-listener-D2NHQ5Og.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
2
|
import { a as resolveWhatsAppAccount } from "./accounts-B4oR6Dhx.js";
|
|
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-
|
|
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";
|
|
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
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-
|
|
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-
|
|
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";
|
|
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-BCZXDJbM.js");
|
|
5
5
|
return loginQrModulePromise;
|
|
6
6
|
}
|
|
7
7
|
async function startWebLoginWithQr(...args) {
|
|
@@ -3,15 +3,15 @@ import { t as isWhatsAppGroupJid } from "./normalize-target-ePanEpfY.js";
|
|
|
3
3
|
import { t as resolveWhatsAppReactionLevel } from "./reaction-level-2m9sWGCw.js";
|
|
4
4
|
import { n as getStatusCode, t as formatError } from "./session-errors-CSuKZPub.js";
|
|
5
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-
|
|
7
|
-
import { r as sendReactionWhatsApp } from "./send-
|
|
6
|
+
import { i as prepareWhatsAppOutboundMedia, o as sendWhatsAppOutboundWithRetry, r as normalizeWhatsAppPayloadTextPreservingIndentation, t as normalizeWhatsAppOutboundPayload } from "./outbound-media-contract-DwACmTqZ.js";
|
|
7
|
+
import { r as sendReactionWhatsApp } from "./send-DG5fpuQZ.js";
|
|
8
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-
|
|
9
|
+
import { _ as readWebSelfIdentityForDecision, a as getWebAuthAgeMs, h as readWebSelfId, r as WhatsAppAuthUnstableError, s as logoutWeb } from "./auth-store-Cr3tg0Jm.js";
|
|
10
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
11
|
import { i as resolveWhatsAppInboundPolicy, n as checkInboundAccessControl, r as resolveWhatsAppCommandAuthorized } from "./access-control-Di_o41dj.js";
|
|
12
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-DYiQpIng.js";
|
|
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-
|
|
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";
|
|
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";
|
|
@@ -35,7 +35,7 @@ import { dispatchReplyWithBufferedBlockDispatcher, finalizeInboundContext, resol
|
|
|
35
35
|
import { createInboundDebouncer, resolveInboundDebounceMs } from "openclaw/plugin-sdk/channel-inbound-debounce";
|
|
36
36
|
import { hasControlCommand, hasControlCommand as hasControlCommand$1, isControlCommandMessage, shouldComputeCommandAuthorized } from "openclaw/plugin-sdk/command-detection";
|
|
37
37
|
import { drainPendingDeliveries } from "openclaw/plugin-sdk/delivery-queue-runtime";
|
|
38
|
-
import { DEFAULT_GROUP_HISTORY_LIMIT, buildHistoryContextFromEntries,
|
|
38
|
+
import { DEFAULT_GROUP_HISTORY_LIMIT, buildHistoryContextFromEntries, buildInboundHistoryFromEntries, createChannelHistoryWindow } from "openclaw/plugin-sdk/reply-history";
|
|
39
39
|
import { enqueueSystemEvent } from "openclaw/plugin-sdk/system-event-runtime";
|
|
40
40
|
import { createClaimableDedupe } from "openclaw/plugin-sdk/persistent-dedupe";
|
|
41
41
|
import { saveMediaStream } from "openclaw/plugin-sdk/media-store";
|
|
@@ -1265,8 +1265,7 @@ function isOwnerSender(baseMentionConfig, msg) {
|
|
|
1265
1265
|
function recordPendingGroupHistoryEntry(params) {
|
|
1266
1266
|
const senderIdentity = getSenderIdentity(params.msg);
|
|
1267
1267
|
const sender = senderIdentity.name && senderIdentity.e164 ? `${senderIdentity.name} (${senderIdentity.e164})` : senderIdentity.name ?? senderIdentity.e164 ?? getPrimaryIdentityId(senderIdentity) ?? "Unknown";
|
|
1268
|
-
|
|
1269
|
-
historyMap: params.groupHistories,
|
|
1268
|
+
createChannelHistoryWindow({ historyMap: params.groupHistories }).record({
|
|
1270
1269
|
historyKey: params.groupHistoryKey,
|
|
1271
1270
|
limit: params.groupHistoryLimit,
|
|
1272
1271
|
entry: {
|
|
@@ -1743,11 +1742,15 @@ function resolveWhatsAppResponsePrefix(params) {
|
|
|
1743
1742
|
return params.pipelineResponsePrefix ?? (configuredResponsePrefix === void 0 && params.isSelfChat ? resolveIdentityNamePrefix$1(params.cfg, params.agentId) : void 0);
|
|
1744
1743
|
}
|
|
1745
1744
|
function buildWhatsAppInboundContext(params) {
|
|
1746
|
-
const inboundHistory = params.msg.chatType === "group" ? (
|
|
1747
|
-
|
|
1748
|
-
|
|
1749
|
-
|
|
1750
|
-
|
|
1745
|
+
const inboundHistory = params.msg.chatType === "group" ? buildInboundHistoryFromEntries({
|
|
1746
|
+
entries: (params.groupHistory ?? []).map((entry) => ({
|
|
1747
|
+
sender: entry.sender,
|
|
1748
|
+
body: entry.body,
|
|
1749
|
+
timestamp: entry.timestamp,
|
|
1750
|
+
messageId: entry.id
|
|
1751
|
+
})),
|
|
1752
|
+
limit: params.groupHistory?.length ?? 1
|
|
1753
|
+
}) : void 0;
|
|
1751
1754
|
return finalizeInboundContext({
|
|
1752
1755
|
Body: params.combinedBody,
|
|
1753
1756
|
BodyForAgent: params.bodyForAgent ?? params.msg.body,
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { t as resolveWhatsAppOutboundTarget } from "./resolve-outbound-target-BKcv4ofn.js";
|
|
2
|
-
import { n as normalizeWhatsAppPayloadText } from "./outbound-media-contract-
|
|
3
|
-
import { t as createWhatsAppOutboundBase } from "./outbound-base-
|
|
2
|
+
import { n as normalizeWhatsAppPayloadText } from "./outbound-media-contract-DwACmTqZ.js";
|
|
3
|
+
import { t as createWhatsAppOutboundBase } from "./outbound-base-Cs2ntgBb.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-DG5fpuQZ.js").then((n) => n.a);
|
|
10
10
|
return whatsAppSendModulePromise;
|
|
11
11
|
}
|
|
12
12
|
function normalizeOutboundText(text) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { p as toWhatsappJid } from "./text-runtime-CMxQczvs.js";
|
|
2
|
-
import { n as normalizeWhatsAppPayloadText, t as normalizeWhatsAppOutboundPayload } from "./outbound-media-contract-
|
|
2
|
+
import { n as normalizeWhatsAppPayloadText, t as normalizeWhatsAppOutboundPayload } from "./outbound-media-contract-DwACmTqZ.js";
|
|
3
3
|
import { i as lookupInboundMessageMetaForTarget } from "./quoted-message-BQsRXnac.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";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as whatsappOutbound } from "./outbound-adapter-
|
|
1
|
+
import { t as whatsappOutbound } from "./outbound-adapter-QDdZXpZB.js";
|
|
2
2
|
export { whatsappOutbound };
|
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-
|
|
2
|
+
import { n as whatsAppActionRuntime, t as handleWhatsAppAction } from "./action-runtime-Dig47HuK.js";
|
|
3
3
|
import { n as getStatusCode, t as formatError } from "./session-errors-CSuKZPub.js";
|
|
4
|
-
import { i as sendTypingWhatsApp, n as sendPollWhatsApp, r as sendReactionWhatsApp, t as sendMessageWhatsApp } from "./send-
|
|
4
|
+
import { i as sendTypingWhatsApp, n as sendPollWhatsApp, r as sendReactionWhatsApp, t as sendMessageWhatsApp } from "./send-DG5fpuQZ.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-Cr3tg0Jm.js";
|
|
9
9
|
import { t as DEFAULT_WEB_MEDIA_BYTES } from "./constants-yKXGCGU9.js";
|
|
10
10
|
import { c as extractContactContext, d as extractMediaPlaceholder, p as extractText, u as extractLocationData } from "./send-api-DYiQpIng.js";
|
|
11
|
-
import { n as newConnectionId, r as waitForWaConnection, t as createWaSocket } from "./session-
|
|
11
|
+
import { n as newConnectionId, r as waitForWaConnection, t as createWaSocket } from "./session-B4Rnsd-V.js";
|
|
12
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-
|
|
14
|
-
import { t as loginWeb } from "./login-
|
|
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-BVvWWOfi.js";
|
|
14
|
+
import { t as loginWeb } from "./login-CxQb0cqz.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 };
|
|
@@ -5,7 +5,7 @@ import { n as isWhatsAppNewsletterJid } from "./normalize-target-ePanEpfY.js";
|
|
|
5
5
|
import { t as getRegisteredWhatsAppConnectionController } from "./connection-controller-registry-D_iIGz5m.js";
|
|
6
6
|
import "./normalize-f31evwm8.js";
|
|
7
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-
|
|
8
|
+
import { a as resolveWhatsAppOutboundMediaUrls, i as prepareWhatsAppOutboundMedia, n as normalizeWhatsAppPayloadText } from "./outbound-media-contract-DwACmTqZ.js";
|
|
9
9
|
import { formatCliCommand } from "openclaw/plugin-sdk/cli-runtime";
|
|
10
10
|
import { generateSecureUuid } from "openclaw/plugin-sdk/core";
|
|
11
11
|
import { redactIdentifier } from "openclaw/plugin-sdk/logging-core";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { n as resolveWebCredsBackupPath, r as resolveWebCredsPath } from "./creds-files-_2V8jzQa.js";
|
|
2
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-
|
|
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";
|
|
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";
|
|
@@ -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-ChxB8Ns0.js");
|
|
129
129
|
}
|
|
130
130
|
async function loadWhatsAppSetupSurface() {
|
|
131
|
-
return await import("./setup-surface-
|
|
131
|
+
return await import("./setup-surface-7163OZHk.js");
|
|
132
132
|
}
|
|
133
133
|
const whatsappSetupWizardProxy = createWhatsAppSetupWizardProxy(async () => (await loadWhatsAppSetupSurface()).whatsappSetupWizard);
|
|
134
134
|
const whatsappConfigAdapter = createScopedChannelConfigAdapter({
|
|
@@ -250,7 +250,7 @@ function createWhatsAppPluginBase(params) {
|
|
|
250
250
|
configPrefixes: ["web"],
|
|
251
251
|
noopPrefixes: ["channels.whatsapp"]
|
|
252
252
|
},
|
|
253
|
-
|
|
253
|
+
gatewayMethodDescriptors: [{ name: "web.login.start" }, { name: "web.login.wait" }],
|
|
254
254
|
configSchema: WhatsAppChannelConfigSchema,
|
|
255
255
|
config: {
|
|
256
256
|
...whatsappConfigAdapter,
|
|
@@ -283,7 +283,7 @@ function createWhatsAppPluginBase(params) {
|
|
|
283
283
|
setupWizard: base.setupWizard,
|
|
284
284
|
capabilities: base.capabilities,
|
|
285
285
|
reload: base.reload,
|
|
286
|
-
|
|
286
|
+
gatewayMethodDescriptors: base.gatewayMethodDescriptors,
|
|
287
287
|
configSchema: base.configSchema,
|
|
288
288
|
config: base.config,
|
|
289
289
|
messaging: {
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { r as resolveDefaultWhatsAppAccountId } from "./account-ids-DG18xddX.js";
|
|
2
2
|
import { a as resolveWhatsAppAccount, o as resolveWhatsAppAuthDir } from "./accounts-B4oR6Dhx.js";
|
|
3
3
|
import { a as normalizeWhatsAppAllowFromEntries, o as normalizeWhatsAppAllowFromEntry } from "./normalize-target-ePanEpfY.js";
|
|
4
|
-
import { t as whatsappSetupAdapter } from "./setup-core-
|
|
4
|
+
import { t as whatsappSetupAdapter } from "./setup-core-B5F7F8bE.js";
|
|
5
5
|
import path from "node:path";
|
|
6
|
-
import { DEFAULT_ACCOUNT_ID, pathExists, splitSetupEntries } from "openclaw/plugin-sdk/setup";
|
|
6
|
+
import { DEFAULT_ACCOUNT_ID, createSetupTranslator, pathExists, splitSetupEntries } from "openclaw/plugin-sdk/setup";
|
|
7
7
|
import { formatCliCommand, formatDocsLink } from "openclaw/plugin-sdk/setup-tools";
|
|
8
8
|
//#region extensions/whatsapp/src/setup-finalize.ts
|
|
9
|
+
const t = createSetupTranslator();
|
|
9
10
|
function trimPromptText(value) {
|
|
10
11
|
return value?.trim() ?? "";
|
|
11
12
|
}
|
|
@@ -92,14 +93,14 @@ async function detectWhatsAppLinked(cfg, accountId) {
|
|
|
92
93
|
}
|
|
93
94
|
async function promptWhatsAppOwnerAllowFrom(params) {
|
|
94
95
|
const { prompter, existingAllowFrom } = params;
|
|
95
|
-
await prompter.note("
|
|
96
|
+
await prompter.note(t("wizard.whatsapp.ownerNumberNote"), t("wizard.whatsapp.numberTitle"));
|
|
96
97
|
const normalized = normalizeWhatsAppAllowFromEntry(trimPromptText(await prompter.text({
|
|
97
|
-
message: "
|
|
98
|
+
message: t("wizard.whatsapp.personalNumberPrompt"),
|
|
98
99
|
placeholder: "+15555550123",
|
|
99
100
|
initialValue: existingAllowFrom[0],
|
|
100
101
|
validate: (value) => {
|
|
101
102
|
const raw = trimPromptText(value);
|
|
102
|
-
if (!raw) return "
|
|
103
|
+
if (!raw) return t("common.required");
|
|
103
104
|
if (!normalizeWhatsAppAllowFromEntry(raw)) return `Invalid number: ${raw}`;
|
|
104
105
|
}
|
|
105
106
|
})));
|
|
@@ -155,8 +156,8 @@ async function promptWhatsAppDmAccess(params) {
|
|
|
155
156
|
accountId,
|
|
156
157
|
prompter: params.prompter,
|
|
157
158
|
existingAllowFrom,
|
|
158
|
-
title: "
|
|
159
|
-
messageLines: ["
|
|
159
|
+
title: t("wizard.whatsapp.allowlistTitle"),
|
|
160
|
+
messageLines: [t("wizard.whatsapp.allowlistModeEnabled")]
|
|
160
161
|
});
|
|
161
162
|
await params.prompter.note([
|
|
162
163
|
`WhatsApp direct chats are gated by \`${policyKey}\` + \`${allowFromKey}\`.`,
|
|
@@ -166,43 +167,43 @@ async function promptWhatsAppDmAccess(params) {
|
|
|
166
167
|
"- disabled: ignore WhatsApp DMs",
|
|
167
168
|
"",
|
|
168
169
|
`Current: dmPolicy=${existingPolicy}, allowFrom=${existingLabel}`,
|
|
169
|
-
|
|
170
|
-
].join("\n"), "
|
|
170
|
+
t("wizard.channels.docs", { link: formatDocsLink("/whatsapp", "whatsapp") })
|
|
171
|
+
].join("\n"), t("wizard.whatsapp.dmAccessTitle"));
|
|
171
172
|
if (await params.prompter.select({
|
|
172
|
-
message: "
|
|
173
|
+
message: t("wizard.whatsapp.phoneSetupPrompt"),
|
|
173
174
|
options: [{
|
|
174
175
|
value: "personal",
|
|
175
|
-
label: "
|
|
176
|
+
label: t("wizard.whatsapp.personalPhoneLabel")
|
|
176
177
|
}, {
|
|
177
178
|
value: "separate",
|
|
178
|
-
label: "
|
|
179
|
+
label: t("wizard.whatsapp.separatePhoneLabel")
|
|
179
180
|
}]
|
|
180
181
|
}) === "personal") return await applyWhatsAppOwnerAllowlist({
|
|
181
182
|
cfg: params.cfg,
|
|
182
183
|
accountId,
|
|
183
184
|
prompter: params.prompter,
|
|
184
185
|
existingAllowFrom,
|
|
185
|
-
title: "
|
|
186
|
-
messageLines: ["
|
|
186
|
+
title: t("wizard.whatsapp.personalPhoneTitle"),
|
|
187
|
+
messageLines: [t("wizard.whatsapp.personalPhoneModeEnabled"), t("wizard.whatsapp.dmPolicySetAllowlist")]
|
|
187
188
|
});
|
|
188
189
|
const policy = await params.prompter.select({
|
|
189
|
-
message: "
|
|
190
|
+
message: t("wizard.whatsapp.dmPolicyPrompt"),
|
|
190
191
|
options: [
|
|
191
192
|
{
|
|
192
193
|
value: "pairing",
|
|
193
|
-
label: "
|
|
194
|
+
label: t("wizard.channels.dmPolicyPairing")
|
|
194
195
|
},
|
|
195
196
|
{
|
|
196
197
|
value: "allowlist",
|
|
197
|
-
label: "
|
|
198
|
+
label: t("wizard.whatsapp.dmPolicyAllowlistOnly")
|
|
198
199
|
},
|
|
199
200
|
{
|
|
200
201
|
value: "open",
|
|
201
|
-
label: "
|
|
202
|
+
label: t("wizard.channels.dmPolicyOpenOption")
|
|
202
203
|
},
|
|
203
204
|
{
|
|
204
205
|
value: "disabled",
|
|
205
|
-
label: "
|
|
206
|
+
label: t("wizard.whatsapp.dmPolicyDisabled")
|
|
206
207
|
}
|
|
207
208
|
]
|
|
208
209
|
});
|
|
@@ -217,25 +218,25 @@ async function promptWhatsAppDmAccess(params) {
|
|
|
217
218
|
const allowOptions = existingAllowFrom.length > 0 ? [
|
|
218
219
|
{
|
|
219
220
|
value: "keep",
|
|
220
|
-
label: "
|
|
221
|
+
label: t("wizard.whatsapp.keepCurrentAllowFrom")
|
|
221
222
|
},
|
|
222
223
|
{
|
|
223
224
|
value: "unset",
|
|
224
|
-
label: "
|
|
225
|
+
label: t("wizard.whatsapp.unsetAllowFromPairing")
|
|
225
226
|
},
|
|
226
227
|
{
|
|
227
228
|
value: "list",
|
|
228
|
-
label: "
|
|
229
|
+
label: t("wizard.whatsapp.setAllowFromNumbers")
|
|
229
230
|
}
|
|
230
231
|
] : [{
|
|
231
232
|
value: "unset",
|
|
232
|
-
label: "
|
|
233
|
+
label: t("wizard.whatsapp.unsetAllowFromDefault")
|
|
233
234
|
}, {
|
|
234
235
|
value: "list",
|
|
235
|
-
label: "
|
|
236
|
+
label: t("wizard.whatsapp.setAllowFromNumbers")
|
|
236
237
|
}];
|
|
237
238
|
const mode = await params.prompter.select({
|
|
238
|
-
message: "
|
|
239
|
+
message: t("wizard.whatsapp.allowFromPrompt"),
|
|
239
240
|
options: allowOptions.map((opt) => ({
|
|
240
241
|
value: opt.value,
|
|
241
242
|
label: opt.label
|
|
@@ -244,13 +245,13 @@ async function promptWhatsAppDmAccess(params) {
|
|
|
244
245
|
if (mode === "keep") return next;
|
|
245
246
|
if (mode === "unset") return setWhatsAppAllowFrom(next, accountId, void 0);
|
|
246
247
|
const parsed = parseWhatsAppAllowFromEntries(trimPromptText(await params.prompter.text({
|
|
247
|
-
message: "
|
|
248
|
+
message: t("wizard.whatsapp.allowedSenderNumbers"),
|
|
248
249
|
placeholder: "+15555550123, +447700900123",
|
|
249
250
|
validate: (value) => {
|
|
250
251
|
const raw = trimPromptText(value);
|
|
251
|
-
if (!raw) return "
|
|
252
|
+
if (!raw) return t("common.required");
|
|
252
253
|
const parsed = parseWhatsAppAllowFromEntries(raw);
|
|
253
|
-
if (parsed.entries.length === 0 && !parsed.invalidEntry) return "
|
|
254
|
+
if (parsed.entries.length === 0 && !parsed.invalidEntry) return t("common.required");
|
|
254
255
|
if (parsed.invalidEntry) return `Invalid number: ${parsed.invalidEntry}`;
|
|
255
256
|
}
|
|
256
257
|
})));
|
|
@@ -271,21 +272,21 @@ async function finalizeWhatsAppSetup(params) {
|
|
|
271
272
|
accountId
|
|
272
273
|
});
|
|
273
274
|
if (!linked) await params.prompter.note([
|
|
274
|
-
"
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
].join("\n"), "
|
|
275
|
+
t("wizard.whatsapp.scanQr"),
|
|
276
|
+
t("wizard.whatsapp.credentialsStored", { authDir }),
|
|
277
|
+
t("wizard.channels.docs", { link: formatDocsLink("/whatsapp", "whatsapp") })
|
|
278
|
+
].join("\n"), t("wizard.whatsapp.linkingTitle"));
|
|
278
279
|
if (await params.prompter.confirm({
|
|
279
|
-
message: linked ? "
|
|
280
|
+
message: linked ? t("wizard.whatsapp.relinkPrompt") : t("wizard.whatsapp.linkNowPrompt"),
|
|
280
281
|
initialValue: !linked
|
|
281
282
|
})) try {
|
|
282
|
-
const { loginWeb } = await import("./login-
|
|
283
|
+
const { loginWeb } = await import("./login-CxQb0cqz.js").then((n) => n.n);
|
|
283
284
|
await loginWeb(false, void 0, params.runtime, accountId);
|
|
284
285
|
} catch (error) {
|
|
285
286
|
params.runtime.error(`WhatsApp login failed: ${String(error)}`);
|
|
286
|
-
await params.prompter.note(
|
|
287
|
+
await params.prompter.note(t("wizard.channels.docs", { link: formatDocsLink("/whatsapp", "whatsapp") }), t("wizard.whatsapp.helpTitle"));
|
|
287
288
|
}
|
|
288
|
-
else if (!linked) await params.prompter.note(
|
|
289
|
+
else if (!linked) await params.prompter.note(t("wizard.whatsapp.linkLater", { command: formatCliCommand("openclaw channels login") }), "WhatsApp");
|
|
289
290
|
next = await promptWhatsAppDmAccess({
|
|
290
291
|
cfg: next,
|
|
291
292
|
accountId,
|
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-BiyPwedi.js";
|
|
2
2
|
export { whatsappSetupPlugin };
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { t as listAccountIds } from "./account-ids-DG18xddX.js";
|
|
2
2
|
import { o as resolveWhatsAppAuthDir } from "./accounts-B4oR6Dhx.js";
|
|
3
|
-
import { i as formatWhatsAppWebAuthStatusState, m as readWebAuthState } from "./auth-store-
|
|
4
|
-
import { DEFAULT_ACCOUNT_ID, setSetupChannelEnabled } from "openclaw/plugin-sdk/setup";
|
|
3
|
+
import { i as formatWhatsAppWebAuthStatusState, m as readWebAuthState } from "./auth-store-Cr3tg0Jm.js";
|
|
4
|
+
import { DEFAULT_ACCOUNT_ID, createSetupTranslator, setSetupChannelEnabled } from "openclaw/plugin-sdk/setup";
|
|
5
5
|
//#region extensions/whatsapp/src/setup-surface.ts
|
|
6
|
+
const t = createSetupTranslator();
|
|
6
7
|
const channel = "whatsapp";
|
|
7
8
|
async function readWhatsAppSetupLinkState(cfg, accountId) {
|
|
8
9
|
const { authDir } = resolveWhatsAppAuthDir({
|
|
@@ -14,10 +15,10 @@ async function readWhatsAppSetupLinkState(cfg, accountId) {
|
|
|
14
15
|
const whatsappSetupWizard = {
|
|
15
16
|
channel,
|
|
16
17
|
status: {
|
|
17
|
-
configuredLabel: "
|
|
18
|
-
unconfiguredLabel: "
|
|
19
|
-
configuredHint: "
|
|
20
|
-
unconfiguredHint: "
|
|
18
|
+
configuredLabel: t("wizard.channels.statusLinked"),
|
|
19
|
+
unconfiguredLabel: t("wizard.channels.statusNotLinked"),
|
|
20
|
+
configuredHint: t("wizard.channels.statusLinked"),
|
|
21
|
+
unconfiguredHint: t("wizard.channels.statusNotLinked"),
|
|
21
22
|
configuredScore: 5,
|
|
22
23
|
unconfiguredScore: 4,
|
|
23
24
|
resolveConfigured: async ({ cfg, accountId }) => {
|
|
@@ -35,7 +36,7 @@ const whatsappSetupWizard = {
|
|
|
35
36
|
},
|
|
36
37
|
resolveShouldPromptAccountIds: ({ shouldPromptAccountIds }) => shouldPromptAccountIds,
|
|
37
38
|
credentials: [],
|
|
38
|
-
finalize: async (params) => await (await import("./setup-finalize-
|
|
39
|
+
finalize: async (params) => await (await import("./setup-finalize-B62sUNjU.js")).finalizeWhatsAppSetup(params),
|
|
39
40
|
disable: (cfg) => setSetupChannelEnabled(cfg, channel, false),
|
|
40
41
|
onAccountRecorded: (accountId, options) => {
|
|
41
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-
|
|
2
|
+
import { t as whatsappOutbound } from "./outbound-adapter-QDdZXpZB.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.
|
|
3
|
+
"version": "2026.5.16-beta.2",
|
|
4
4
|
"description": "OpenClaw WhatsApp channel plugin",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
"openclaw": "workspace:*"
|
|
21
21
|
},
|
|
22
22
|
"peerDependencies": {
|
|
23
|
-
"openclaw": ">=2026.5.
|
|
23
|
+
"openclaw": ">=2026.5.16-beta.2"
|
|
24
24
|
},
|
|
25
25
|
"peerDependenciesMeta": {
|
|
26
26
|
"openclaw": {
|
|
@@ -63,10 +63,10 @@
|
|
|
63
63
|
"minHostVersion": ">=2026.4.25"
|
|
64
64
|
},
|
|
65
65
|
"compat": {
|
|
66
|
-
"pluginApi": ">=2026.5.
|
|
66
|
+
"pluginApi": ">=2026.5.16-beta.2"
|
|
67
67
|
},
|
|
68
68
|
"build": {
|
|
69
|
-
"openclawVersion": "2026.5.
|
|
69
|
+
"openclawVersion": "2026.5.16-beta.2"
|
|
70
70
|
},
|
|
71
71
|
"release": {
|
|
72
72
|
"publishToClawHub": true,
|