@openclaw/whatsapp 2026.5.14-beta.1 → 2026.5.16-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{access-control-BEpPB-Jx.js → access-control-Di_o41dj.js} +1 -1
- 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 +10 -10
- package/dist/{auth-store-_ScMvp7r.js → auth-store-Cr3tg0Jm.js} +2 -2
- package/dist/{channel-yIjmVwof.js → channel-BG0Lv4c9.js} +8 -9
- package/dist/channel-plugin-api.js +1 -1
- package/dist/{channel-react-action-C1wufQtL.js → channel-react-action-Q1STHXmW.js} +1 -1
- package/dist/{channel.runtime-Dc5rfgsF.js → channel.runtime-ChxB8Ns0.js} +5 -5
- package/dist/{channel.setup-KnsEGgS2.js → channel.setup-BiyPwedi.js} +3 -4
- package/dist/{connection-controller-CT8NA6Zf.js → connection-controller-YqKi6Ekq.js} +2 -2
- package/dist/constants.js +1 -1
- package/dist/contract-api.js +3 -3
- package/dist/directory-contract-api.js +1 -1
- package/dist/legacy-state-migrations-api.js +1 -1
- package/dist/light-runtime-api.js +2 -2
- package/dist/{login-B_pa3YAU.js → login-CxQb0cqz.js} +3 -3
- package/dist/{login-qr-C33im-qS.js → login-qr-BCZXDJbM.js} +3 -3
- package/dist/login-qr-runtime.js +1 -1
- package/dist/{monitor-DTi0QRV4.js → monitor-BVvWWOfi.js} +72 -21
- package/dist/{outbound-adapter-Bs0e4qVd.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 +9 -9
- package/dist/{send-DBfXQDd4.js → send-DG5fpuQZ.js} +1 -1
- package/dist/{session-ZZQKkOTz.js → session-B4Rnsd-V.js} +2 -2
- package/dist/{shared-B2VGBfCy.js → setup-core-B5F7F8bE.js} +50 -5
- package/dist/{setup-finalize-C1S1U-hY.js → setup-finalize-B62sUNjU.js} +37 -36
- package/dist/setup-plugin-api.js +1 -1
- package/dist/{setup-surface-BbwSSEsy.js → setup-surface-7163OZHk.js} +8 -7
- package/dist/test-api.js +2 -2
- package/package.json +5 -5
- package/dist/setup-core-DZKvpzbH.js +0 -46
- /package/dist/{active-listener-DTbKS-j-.js → active-listener-D2NHQ5Og.js} +0 -0
- /package/dist/{audio-preflight.runtime-MmkB-pgX.js → audio-preflight.runtime-CIFjeaEN.js} +0 -0
- /package/dist/{constants-DLGCIbfl.js → constants-yKXGCGU9.js} +0 -0
- /package/dist/{directory-config-CE74HYlw.js → directory-config-ClsMAYen.js} +0 -0
- /package/dist/{reply-resolver.runtime-rIVWohXr.js → reply-resolver.runtime-CROyXXQh.js} +0 -0
- /package/dist/{runtime-group-policy-Gp1lQ0at.js → runtime-group-policy-BH_U23qp.js} +0 -0
- /package/dist/{send-api-DD93aPIQ.js → send-api-DYiQpIng.js} +0 -0
- /package/dist/{session.runtime-CZQ0ycCg.js → session.runtime-BxyATGX0.js} +0 -0
- /package/dist/{state-migrations-Bm0S67yH.js → state-migrations-CtdIArlK.js} +0 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { a as resolveWhatsAppAccount } from "./accounts-B4oR6Dhx.js";
|
|
2
2
|
import { l as isSelfChatMode, n as normalizeE164 } from "./text-runtime-CMxQczvs.js";
|
|
3
3
|
import { a as getSelfIdentity, o as getSenderIdentity } from "./identity-BNDkpR8N.js";
|
|
4
|
-
import { t as resolveWhatsAppRuntimeGroupPolicy } from "./runtime-group-policy-
|
|
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";
|
|
7
7
|
import { createChannelPairingChallengeIssuer } from "openclaw/plugin-sdk/channel-pairing";
|
|
@@ -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
|
|
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-
|
|
14
|
-
import { t as DEFAULT_WEB_MEDIA_BYTES } from "./constants-
|
|
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-
|
|
13
|
+
import { t as whatsappSetupPlugin } from "./channel.setup-BiyPwedi.js";
|
|
14
|
+
import { t as DEFAULT_WEB_MEDIA_BYTES } from "./constants-yKXGCGU9.js";
|
|
15
|
+
import { n as listWhatsAppDirectoryGroupsFromConfig, r as listWhatsAppDirectoryPeersFromConfig } from "./directory-config-ClsMAYen.js";
|
|
16
|
+
import { t as __testing } from "./access-control-Di_o41dj.js";
|
|
17
|
+
import { p as extractText, t as createWebSendApi } from "./send-api-DYiQpIng.js";
|
|
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";
|
|
@@ -14,7 +14,7 @@ const CREDS_FILE_MODE = 384;
|
|
|
14
14
|
const CREDS_SAVE_FLUSH_TIMEOUT_MS = 15e3;
|
|
15
15
|
const credsSaveQueues = /* @__PURE__ */ new Map();
|
|
16
16
|
async function stringifyCreds(creds) {
|
|
17
|
-
const { BufferJSON } = await import("./session.runtime-
|
|
17
|
+
const { BufferJSON } = await import("./session.runtime-BxyATGX0.js").then((n) => n.a);
|
|
18
18
|
return JSON.stringify(creds, BufferJSON.replacer);
|
|
19
19
|
}
|
|
20
20
|
async function writeCredsJsonAtomically(authDir, creds) {
|
|
@@ -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,16 +4,15 @@ 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
|
|
14
|
-
import { d as readWebAuthExistsForDecision, n as WHATSAPP_AUTH_UNSTABLE_CODE } from "./auth-store-
|
|
15
|
-
import { t as
|
|
16
|
-
import { t as detectWhatsAppLegacyStateMigrations } from "./state-migrations-Bm0S67yH.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-B5F7F8bE.js";
|
|
14
|
+
import { d as readWebAuthExistsForDecision, n as WHATSAPP_AUTH_UNSTABLE_CODE } from "./auth-store-Cr3tg0Jm.js";
|
|
15
|
+
import { t as detectWhatsAppLegacyStateMigrations } from "./state-migrations-CtdIArlK.js";
|
|
17
16
|
import { createActionGate as createActionGate$1 } from "openclaw/plugin-sdk/channel-actions";
|
|
18
17
|
import { asString, collectIssuesForEnabledAccounts, createAsyncComputedAccountStatusAdapter, createDefaultChannelRuntimeState, isRecord } from "openclaw/plugin-sdk/status-helpers";
|
|
19
18
|
import { formatCliCommand } from "openclaw/plugin-sdk/cli-runtime";
|
|
@@ -322,8 +321,8 @@ function collectWhatsAppStatusIssues(accounts) {
|
|
|
322
321
|
}
|
|
323
322
|
//#endregion
|
|
324
323
|
//#region extensions/whatsapp/src/channel.ts
|
|
325
|
-
const loadWhatsAppDirectoryConfig = createLazyRuntimeModule(() => import("./directory-config-
|
|
326
|
-
const loadWhatsAppChannelReactAction = createLazyRuntimeModule(() => import("./channel-react-action-
|
|
324
|
+
const loadWhatsAppDirectoryConfig = createLazyRuntimeModule(() => import("./directory-config-ClsMAYen.js").then((n) => n.t));
|
|
325
|
+
const loadWhatsAppChannelReactAction = createLazyRuntimeModule(() => import("./channel-react-action-Q1STHXmW.js"));
|
|
327
326
|
function parseWhatsAppExplicitTarget(raw) {
|
|
328
327
|
const normalized = normalizeWhatsAppTarget(raw);
|
|
329
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-
|
|
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-Cr3tg0Jm.js";
|
|
3
|
+
import { t as getActiveWebListener$1 } from "./active-listener-D2NHQ5Og.js";
|
|
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,7 +1,6 @@
|
|
|
1
|
-
import { a as
|
|
2
|
-
import { m as readWebAuthState } from "./auth-store-
|
|
3
|
-
import { t as
|
|
4
|
-
import { t as detectWhatsAppLegacyStateMigrations } from "./state-migrations-Bm0S67yH.js";
|
|
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
|
+
import { t as detectWhatsAppLegacyStateMigrations } from "./state-migrations-CtdIArlK.js";
|
|
5
4
|
//#region extensions/whatsapp/src/channel.setup.ts
|
|
6
5
|
const whatsappSetupPlugin = {
|
|
7
6
|
...createWhatsAppPluginBase({
|
|
@@ -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";
|
package/dist/constants.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as DEFAULT_WEB_MEDIA_BYTES } from "./constants-
|
|
1
|
+
import { t as DEFAULT_WEB_MEDIA_BYTES } from "./constants-yKXGCGU9.js";
|
|
2
2
|
export { DEFAULT_WEB_MEDIA_BYTES };
|
package/dist/contract-api.js
CHANGED
|
@@ -3,9 +3,9 @@ import { t as whatsappCommandPolicy$1 } from "./command-policy-O8sRnqUV.js";
|
|
|
3
3
|
import { t as resolveLegacyGroupSessionKey$1 } from "./group-session-contract-DdqigLJl.js";
|
|
4
4
|
import { n as unsupportedSecretRefSurfacePatterns, t as collectUnsupportedSecretRefConfigCandidates } from "./security-contract-CvfWex9e.js";
|
|
5
5
|
import { r as isLegacyGroupSessionKey$1, t as canonicalizeLegacySessionKey$1 } from "./session-contract-B0efQf9P.js";
|
|
6
|
-
import { n as listWhatsAppDirectoryGroupsFromConfig, r as listWhatsAppDirectoryPeersFromConfig } from "./directory-config-
|
|
7
|
-
import { t as resolveWhatsAppRuntimeGroupPolicy$1 } from "./runtime-group-policy-
|
|
8
|
-
import { t as __testing } from "./access-control-
|
|
6
|
+
import { n as listWhatsAppDirectoryGroupsFromConfig, r as listWhatsAppDirectoryPeersFromConfig } from "./directory-config-ClsMAYen.js";
|
|
7
|
+
import { t as resolveWhatsAppRuntimeGroupPolicy$1 } from "./runtime-group-policy-BH_U23qp.js";
|
|
8
|
+
import { t as __testing } from "./access-control-Di_o41dj.js";
|
|
9
9
|
//#region extensions/whatsapp/contract-api.ts
|
|
10
10
|
const canonicalizeLegacySessionKey = canonicalizeLegacySessionKey$1;
|
|
11
11
|
const isLegacyGroupSessionKey = isLegacyGroupSessionKey$1;
|
|
@@ -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-ClsMAYen.js";
|
|
2
2
|
export { listWhatsAppDirectoryGroupsFromConfig, listWhatsAppDirectoryPeersFromConfig };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as detectWhatsAppLegacyStateMigrations } from "./state-migrations-
|
|
1
|
+
import { t as detectWhatsAppLegacyStateMigrations } from "./state-migrations-CtdIArlK.js";
|
|
2
2
|
export { detectWhatsAppLegacyStateMigrations };
|
|
@@ -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-
|
|
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-Cr3tg0Jm.js";
|
|
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
|
-
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-
|
|
11
|
+
import { i as resolveWhatsAppInboundPolicy, n as checkInboundAccessControl, r as resolveWhatsAppCommandAuthorized } from "./access-control-Di_o41dj.js";
|
|
12
|
+
import { a as mayContainWhatsAppOutboundMention, c as extractContactContext, d as extractMediaPlaceholder, f as extractMentionedJids, i as addWhatsAppOutboundMentionsToContent, l as extractContextInfo, m as hasInboundUserContent, n as listWhatsAppSendResultMessageIds, o as resolveWhatsAppOutboundMentions, p as extractText, r as normalizeWhatsAppSendResult, s as describeReplyContext, t as createWebSendApi, u as extractLocationData } from "./send-api-DYiQpIng.js";
|
|
13
|
+
import { i as resolveWhatsAppSocketTiming, r as waitForWaConnection, t as createWaSocket } from "./session-B4Rnsd-V.js";
|
|
14
|
+
import { c as computeBackoff, d as resolveReconnectPolicy, f as sleepWithAbort, l as newConnectionId, n as WHATSAPP_WATCHDOG_TIMEOUT_ERROR, r as WhatsAppConnectionController, s as DEFAULT_RECONNECT_POLICY, u as resolveHeartbeatSeconds } from "./connection-controller-YqKi6Ekq.js";
|
|
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";
|
|
@@ -33,9 +33,9 @@ import { formatLocationText, resolveInboundSessionEnvelopeContext } from "opencl
|
|
|
33
33
|
import { recordChannelActivity } from "openclaw/plugin-sdk/channel-activity-runtime";
|
|
34
34
|
import { dispatchReplyWithBufferedBlockDispatcher, finalizeInboundContext, resolveChunkMode, resolveTextChunkLimit } from "openclaw/plugin-sdk/reply-runtime";
|
|
35
35
|
import { createInboundDebouncer, resolveInboundDebounceMs } from "openclaw/plugin-sdk/channel-inbound-debounce";
|
|
36
|
-
import { hasControlCommand, hasControlCommand as hasControlCommand$1, shouldComputeCommandAuthorized } from "openclaw/plugin-sdk/command-detection";
|
|
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,
|
|
@@ -1780,6 +1783,8 @@ function buildWhatsAppInboundContext(params) {
|
|
|
1780
1783
|
SenderId: params.sender.id ?? params.sender.e164,
|
|
1781
1784
|
SenderE164: params.sender.e164,
|
|
1782
1785
|
CommandAuthorized: params.commandAuthorized,
|
|
1786
|
+
CommandTurn: params.commandTurn,
|
|
1787
|
+
CommandSource: params.commandSource ?? (params.commandTurn?.source === "native" || params.commandTurn?.source === "text" ? params.commandTurn.source : void 0),
|
|
1783
1788
|
ReplyThreading: params.replyThreading,
|
|
1784
1789
|
WasMentioned: params.msg.wasMentioned,
|
|
1785
1790
|
GroupSystemPrompt: params.groupSystemPrompt,
|
|
@@ -1791,6 +1796,33 @@ function buildWhatsAppInboundContext(params) {
|
|
|
1791
1796
|
OriginatingTo: params.msg.from
|
|
1792
1797
|
});
|
|
1793
1798
|
}
|
|
1799
|
+
function normalizeCommandTurnFromContext(value) {
|
|
1800
|
+
if (!value || typeof value !== "object") return;
|
|
1801
|
+
const record = value;
|
|
1802
|
+
const kind = record.kind;
|
|
1803
|
+
const source = record.source;
|
|
1804
|
+
if (kind === "native" && source === "native" && typeof record.authorized === "boolean") return {
|
|
1805
|
+
kind: "native",
|
|
1806
|
+
source: "native",
|
|
1807
|
+
authorized: record.authorized,
|
|
1808
|
+
commandName: typeof record.commandName === "string" ? record.commandName : void 0,
|
|
1809
|
+
body: typeof record.body === "string" ? record.body : void 0
|
|
1810
|
+
};
|
|
1811
|
+
if (kind === "text-slash" && source === "text" && typeof record.authorized === "boolean") return {
|
|
1812
|
+
kind: "text-slash",
|
|
1813
|
+
source: "text",
|
|
1814
|
+
authorized: record.authorized,
|
|
1815
|
+
commandName: typeof record.commandName === "string" ? record.commandName : void 0,
|
|
1816
|
+
body: typeof record.body === "string" ? record.body : void 0
|
|
1817
|
+
};
|
|
1818
|
+
if (kind === "normal" && source === "message") return {
|
|
1819
|
+
kind: "normal",
|
|
1820
|
+
source: "message",
|
|
1821
|
+
authorized: false,
|
|
1822
|
+
commandName: typeof record.commandName === "string" ? record.commandName : void 0,
|
|
1823
|
+
body: typeof record.body === "string" ? record.body : void 0
|
|
1824
|
+
};
|
|
1825
|
+
}
|
|
1794
1826
|
function resolveWhatsAppDmRouteTarget(params) {
|
|
1795
1827
|
if (params.msg.chatType === "group") return;
|
|
1796
1828
|
if (params.senderE164) return params.normalizeE164(params.senderE164) ?? void 0;
|
|
@@ -1835,11 +1867,16 @@ async function dispatchWhatsAppBufferedReply(params) {
|
|
|
1835
1867
|
});
|
|
1836
1868
|
const mediaLocalRoots = getAgentScopedMediaLocalRoots(params.cfg, params.route.agentId);
|
|
1837
1869
|
const sourceReplyChatType = typeof params.context.ChatType === "string" ? params.context.ChatType : params.msg.chatType;
|
|
1870
|
+
const sourceReplyCommandSource = params.context.CommandSource === "native" || params.context.CommandSource === "text" ? params.context.CommandSource : void 0;
|
|
1871
|
+
const sourceReplyCommandTurn = normalizeCommandTurnFromContext(params.context.CommandTurn);
|
|
1872
|
+
const sourceReplyCommandAuthorized = typeof params.context.CommandAuthorized === "boolean" ? params.context.CommandAuthorized : void 0;
|
|
1838
1873
|
const sourceReplyDeliveryMode = sourceReplyChatType === "group" || sourceReplyChatType === "channel" ? resolveChannelMessageSourceReplyDeliveryMode({
|
|
1839
1874
|
cfg: params.cfg,
|
|
1840
1875
|
ctx: {
|
|
1841
1876
|
ChatType: sourceReplyChatType,
|
|
1842
|
-
|
|
1877
|
+
CommandTurn: sourceReplyCommandTurn,
|
|
1878
|
+
CommandSource: sourceReplyCommandSource,
|
|
1879
|
+
CommandAuthorized: sourceReplyCommandAuthorized
|
|
1843
1880
|
}
|
|
1844
1881
|
}) : void 0;
|
|
1845
1882
|
const disableBlockStreaming = sourceReplyDeliveryMode === "message_tool_only" ? true : resolveWhatsAppDisableBlockStreaming(params.cfg);
|
|
@@ -2202,7 +2239,7 @@ async function processMessage(params) {
|
|
|
2202
2239
|
let audioTranscript = params.preflightAudioTranscript ?? void 0;
|
|
2203
2240
|
const hasAudioBody = params.msg.mediaType?.startsWith("audio/") === true && params.msg.body === "<media:audio>";
|
|
2204
2241
|
if (params.preflightAudioTranscript === void 0 && hasAudioBody && params.msg.mediaPath) try {
|
|
2205
|
-
const { transcribeFirstAudio } = await import("./audio-preflight.runtime-
|
|
2242
|
+
const { transcribeFirstAudio } = await import("./audio-preflight.runtime-CIFjeaEN.js");
|
|
2206
2243
|
audioTranscript = await transcribeFirstAudio({
|
|
2207
2244
|
ctx: {
|
|
2208
2245
|
MediaPaths: [params.msg.mediaPath],
|
|
@@ -2320,11 +2357,24 @@ async function processMessage(params) {
|
|
|
2320
2357
|
senderE164: sender.e164 ?? void 0,
|
|
2321
2358
|
normalizeE164
|
|
2322
2359
|
});
|
|
2323
|
-
const
|
|
2360
|
+
const shouldCheckCommandAuth = shouldComputeCommandAuthorized(params.msg.body, params.cfg);
|
|
2361
|
+
const isTextCommand = isControlCommandMessage(params.msg.body, params.cfg);
|
|
2362
|
+
const commandAuthorized = shouldCheckCommandAuth ? await resolveWhatsAppCommandAuthorized({
|
|
2324
2363
|
cfg: params.cfg,
|
|
2325
2364
|
msg: params.msg,
|
|
2326
2365
|
policy: inboundPolicy
|
|
2327
2366
|
}) : void 0;
|
|
2367
|
+
const commandTurn = isTextCommand ? {
|
|
2368
|
+
kind: "text-slash",
|
|
2369
|
+
source: "text",
|
|
2370
|
+
authorized: Boolean(commandAuthorized),
|
|
2371
|
+
body: params.msg.body
|
|
2372
|
+
} : {
|
|
2373
|
+
kind: "normal",
|
|
2374
|
+
source: "message",
|
|
2375
|
+
authorized: false,
|
|
2376
|
+
body: params.msg.body
|
|
2377
|
+
};
|
|
2328
2378
|
const { onModelSelected, ...replyPipeline } = createChannelMessageReplyPipeline({
|
|
2329
2379
|
cfg: params.cfg,
|
|
2330
2380
|
agentId: params.route.agentId,
|
|
@@ -2350,6 +2400,7 @@ async function processMessage(params) {
|
|
|
2350
2400
|
combinedBody,
|
|
2351
2401
|
commandBody: params.msg.body,
|
|
2352
2402
|
commandAuthorized,
|
|
2403
|
+
commandTurn,
|
|
2353
2404
|
conversationId,
|
|
2354
2405
|
groupHistory: visibleGroupHistory,
|
|
2355
2406
|
groupMemberRoster: params.groupMemberNames.get(params.groupHistoryKey),
|
|
@@ -2555,7 +2606,7 @@ function createWebOnMessageHandler(params) {
|
|
|
2555
2606
|
ackAlreadySent = ackReaction !== null;
|
|
2556
2607
|
}
|
|
2557
2608
|
try {
|
|
2558
|
-
const { transcribeFirstAudio } = await import("./audio-preflight.runtime-
|
|
2609
|
+
const { transcribeFirstAudio } = await import("./audio-preflight.runtime-CIFjeaEN.js");
|
|
2559
2610
|
preflightAudioTranscript = await transcribeFirstAudio({
|
|
2560
2611
|
ctx: {
|
|
2561
2612
|
MediaPaths: [msg.mediaPath],
|
|
@@ -2680,7 +2731,7 @@ function isNonRetryableWebCloseStatus(statusCode) {
|
|
|
2680
2731
|
}
|
|
2681
2732
|
let replyResolverRuntimePromise = null;
|
|
2682
2733
|
function loadReplyResolverRuntime() {
|
|
2683
|
-
replyResolverRuntimePromise ??= import("./reply-resolver.runtime-
|
|
2734
|
+
replyResolverRuntimePromise ??= import("./reply-resolver.runtime-CROyXXQh.js");
|
|
2684
2735
|
return replyResolverRuntimePromise;
|
|
2685
2736
|
}
|
|
2686
2737
|
function resolveWebMonitorConfigSnapshot(params) {
|
|
@@ -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-
|
|
9
|
-
import { t as DEFAULT_WEB_MEDIA_BYTES } from "./constants-
|
|
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-
|
|
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
|
+
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-DYiQpIng.js";
|
|
11
|
+
import { n as newConnectionId, r as waitForWaConnection, t as createWaSocket } from "./session-B4Rnsd-V.js";
|
|
12
|
+
import { n as resolveWebAccountId, t as getActiveWebListener } from "./active-listener-D2NHQ5Og.js";
|
|
13
|
+
import { a as loadWebMediaRaw, c as monitorWebInbox, i as loadWebMedia, l as resetWebInboundDedupe, n as LocalMediaAccessError, o as optimizeImageToJpeg, r as getDefaultLocalRoots, s as optimizeImageToPng, t as monitorWebChannel } from "./monitor-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,7 +1,7 @@
|
|
|
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-
|
|
4
|
-
import { i as makeWASocket, n as fetchLatestBaileysVersion, o as useMultiFileAuthState, r as makeCacheableSignalKeyStore, t as DisconnectReason } from "./session.runtime-
|
|
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
|
+
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";
|
|
7
7
|
import { danger, getChildLogger, success, toPinoLikeLogger } from "openclaw/plugin-sdk/runtime-env";
|
|
@@ -15,6 +15,7 @@ import { describeAccountSnapshot } from "openclaw/plugin-sdk/account-helpers";
|
|
|
15
15
|
import { adaptScopedAccountAccessor, createScopedChannelConfigAdapter, createScopedDmSecurityResolver } from "openclaw/plugin-sdk/channel-config-helpers";
|
|
16
16
|
import { createDelegatedSetupWizardProxy } from "openclaw/plugin-sdk/setup-runtime";
|
|
17
17
|
import { readChannelAllowFromStore } from "openclaw/plugin-sdk/channel-pairing";
|
|
18
|
+
import { applyAccountNameToChannelSection, migrateBaseNameToDefaultAccount, normalizeAccountId as normalizeAccountId$2 } from "openclaw/plugin-sdk/setup";
|
|
18
19
|
//#region extensions/whatsapp/src/config-accessors.ts
|
|
19
20
|
function formatWhatsAppConfigAllowFromEntries(allowFrom) {
|
|
20
21
|
return normalizeWhatsAppAllowFromEntries(allowFrom);
|
|
@@ -124,10 +125,10 @@ function resolveWhatsAppConfigPath(params) {
|
|
|
124
125
|
return `${resolveWhatsAppGroupScopeBasePath(params)}.${params.field}`;
|
|
125
126
|
}
|
|
126
127
|
async function loadWhatsAppChannelRuntime() {
|
|
127
|
-
return await import("./channel.runtime-
|
|
128
|
+
return await import("./channel.runtime-ChxB8Ns0.js");
|
|
128
129
|
}
|
|
129
130
|
async function loadWhatsAppSetupSurface() {
|
|
130
|
-
return await import("./setup-surface-
|
|
131
|
+
return await import("./setup-surface-7163OZHk.js");
|
|
131
132
|
}
|
|
132
133
|
const whatsappSetupWizardProxy = createWhatsAppSetupWizardProxy(async () => (await loadWhatsAppSetupSurface()).whatsappSetupWizard);
|
|
133
134
|
const whatsappConfigAdapter = createScopedChannelConfigAdapter({
|
|
@@ -249,7 +250,7 @@ function createWhatsAppPluginBase(params) {
|
|
|
249
250
|
configPrefixes: ["web"],
|
|
250
251
|
noopPrefixes: ["channels.whatsapp"]
|
|
251
252
|
},
|
|
252
|
-
|
|
253
|
+
gatewayMethodDescriptors: [{ name: "web.login.start" }, { name: "web.login.wait" }],
|
|
253
254
|
configSchema: WhatsAppChannelConfigSchema,
|
|
254
255
|
config: {
|
|
255
256
|
...whatsappConfigAdapter,
|
|
@@ -282,7 +283,7 @@ function createWhatsAppPluginBase(params) {
|
|
|
282
283
|
setupWizard: base.setupWizard,
|
|
283
284
|
capabilities: base.capabilities,
|
|
284
285
|
reload: base.reload,
|
|
285
|
-
|
|
286
|
+
gatewayMethodDescriptors: base.gatewayMethodDescriptors,
|
|
286
287
|
configSchema: base.configSchema,
|
|
287
288
|
config: base.config,
|
|
288
289
|
messaging: {
|
|
@@ -304,4 +305,48 @@ function createWhatsAppPluginBase(params) {
|
|
|
304
305
|
};
|
|
305
306
|
}
|
|
306
307
|
//#endregion
|
|
307
|
-
|
|
308
|
+
//#region extensions/whatsapp/src/setup-core.ts
|
|
309
|
+
const channel = "whatsapp";
|
|
310
|
+
const whatsappSetupAdapter = {
|
|
311
|
+
resolveAccountId: ({ accountId }) => normalizeAccountId$2(accountId),
|
|
312
|
+
applyAccountName: ({ cfg, accountId, name }) => applyAccountNameToChannelSection({
|
|
313
|
+
cfg,
|
|
314
|
+
channelKey: channel,
|
|
315
|
+
accountId,
|
|
316
|
+
name,
|
|
317
|
+
alwaysUseAccounts: true
|
|
318
|
+
}),
|
|
319
|
+
applyAccountConfig: ({ cfg, accountId, input }) => {
|
|
320
|
+
const next = migrateBaseNameToDefaultAccount({
|
|
321
|
+
cfg: applyAccountNameToChannelSection({
|
|
322
|
+
cfg,
|
|
323
|
+
channelKey: channel,
|
|
324
|
+
accountId,
|
|
325
|
+
name: input.name,
|
|
326
|
+
alwaysUseAccounts: true
|
|
327
|
+
}),
|
|
328
|
+
channelKey: channel,
|
|
329
|
+
alwaysUseAccounts: true
|
|
330
|
+
});
|
|
331
|
+
const entry = {
|
|
332
|
+
...next.channels?.whatsapp?.accounts?.[accountId],
|
|
333
|
+
...input.authDir ? { authDir: input.authDir } : {},
|
|
334
|
+
enabled: true
|
|
335
|
+
};
|
|
336
|
+
return {
|
|
337
|
+
...next,
|
|
338
|
+
channels: {
|
|
339
|
+
...next.channels,
|
|
340
|
+
whatsapp: {
|
|
341
|
+
...next.channels?.whatsapp,
|
|
342
|
+
accounts: {
|
|
343
|
+
...next.channels?.whatsapp?.accounts,
|
|
344
|
+
[accountId]: entry
|
|
345
|
+
}
|
|
346
|
+
}
|
|
347
|
+
}
|
|
348
|
+
};
|
|
349
|
+
}
|
|
350
|
+
};
|
|
351
|
+
//#endregion
|
|
352
|
+
export { resolveWhatsAppGroupRequireMention as a, resolveWhatsAppMentionStripRegexes as c, whatsappSetupWizardProxy as i, formatWhatsAppConfigAllowFromEntries as l, createWhatsAppPluginBase as n, resolveWhatsAppGroupToolPolicy as o, loadWhatsAppChannelRuntime as r, resolveWhatsAppGroupIntroHint as s, whatsappSetupAdapter as t };
|
|
@@ -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
|
-
import { t as resolveWhatsAppRuntimeGroupPolicy } from "./runtime-group-policy-
|
|
2
|
-
import { t as whatsappOutbound } from "./outbound-adapter-
|
|
1
|
+
import { t as resolveWhatsAppRuntimeGroupPolicy } from "./runtime-group-policy-BH_U23qp.js";
|
|
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.1",
|
|
4
4
|
"description": "OpenClaw WhatsApp channel plugin",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -13,14 +13,14 @@
|
|
|
13
13
|
"https-proxy-agent": "9.0.0",
|
|
14
14
|
"jimp": "1.6.1",
|
|
15
15
|
"typebox": "1.1.38",
|
|
16
|
-
"undici": "8.
|
|
16
|
+
"undici": "8.3.0"
|
|
17
17
|
},
|
|
18
18
|
"devDependencies": {
|
|
19
19
|
"@openclaw/plugin-sdk": "workspace:*",
|
|
20
20
|
"openclaw": "workspace:*"
|
|
21
21
|
},
|
|
22
22
|
"peerDependencies": {
|
|
23
|
-
"openclaw": ">=2026.5.
|
|
23
|
+
"openclaw": ">=2026.5.16-beta.1"
|
|
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.1"
|
|
67
67
|
},
|
|
68
68
|
"build": {
|
|
69
|
-
"openclawVersion": "2026.5.
|
|
69
|
+
"openclawVersion": "2026.5.16-beta.1"
|
|
70
70
|
},
|
|
71
71
|
"release": {
|
|
72
72
|
"publishToClawHub": true,
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
import { applyAccountNameToChannelSection, migrateBaseNameToDefaultAccount, normalizeAccountId } from "openclaw/plugin-sdk/setup";
|
|
2
|
-
//#region extensions/whatsapp/src/setup-core.ts
|
|
3
|
-
const channel = "whatsapp";
|
|
4
|
-
const whatsappSetupAdapter = {
|
|
5
|
-
resolveAccountId: ({ accountId }) => normalizeAccountId(accountId),
|
|
6
|
-
applyAccountName: ({ cfg, accountId, name }) => applyAccountNameToChannelSection({
|
|
7
|
-
cfg,
|
|
8
|
-
channelKey: channel,
|
|
9
|
-
accountId,
|
|
10
|
-
name,
|
|
11
|
-
alwaysUseAccounts: true
|
|
12
|
-
}),
|
|
13
|
-
applyAccountConfig: ({ cfg, accountId, input }) => {
|
|
14
|
-
const next = migrateBaseNameToDefaultAccount({
|
|
15
|
-
cfg: applyAccountNameToChannelSection({
|
|
16
|
-
cfg,
|
|
17
|
-
channelKey: channel,
|
|
18
|
-
accountId,
|
|
19
|
-
name: input.name,
|
|
20
|
-
alwaysUseAccounts: true
|
|
21
|
-
}),
|
|
22
|
-
channelKey: channel,
|
|
23
|
-
alwaysUseAccounts: true
|
|
24
|
-
});
|
|
25
|
-
const entry = {
|
|
26
|
-
...next.channels?.whatsapp?.accounts?.[accountId],
|
|
27
|
-
...input.authDir ? { authDir: input.authDir } : {},
|
|
28
|
-
enabled: true
|
|
29
|
-
};
|
|
30
|
-
return {
|
|
31
|
-
...next,
|
|
32
|
-
channels: {
|
|
33
|
-
...next.channels,
|
|
34
|
-
whatsapp: {
|
|
35
|
-
...next.channels?.whatsapp,
|
|
36
|
-
accounts: {
|
|
37
|
-
...next.channels?.whatsapp?.accounts,
|
|
38
|
-
[accountId]: entry
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
};
|
|
43
|
-
}
|
|
44
|
-
};
|
|
45
|
-
//#endregion
|
|
46
|
-
export { whatsappSetupAdapter as t };
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|