@openclaw/whatsapp 2026.6.2-beta.1 → 2026.6.5-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/api.js +5 -11
- package/dist/{auth-store-CZ22aNcV.js → auth-store-B2ZibndQ.js} +1 -1
- package/dist/{channel-gnvuSqEF.js → channel-CK_4OwYn.js} +2 -2
- package/dist/channel-plugin-api.js +1 -1
- package/dist/{channel.runtime-BrTuMVQR.js → channel.runtime-DIAo-4Bj.js} +4 -4
- package/dist/{channel.setup-WXGct37Q.js → channel.setup-I-zFGu02.js} +2 -2
- package/dist/{connection-controller-B07CNCkw.js → connection-controller-BnRkIjlP.js} +19 -8
- package/dist/light-runtime-api.js +1 -1
- package/dist/{login-CRtqboZq.js → login-Bflq347x.js} +3 -3
- package/dist/{login-qr-B27eAPhh.js → login-qr-CHWzkQq4.js} +3 -3
- package/dist/login-qr-runtime.js +1 -1
- package/dist/{monitor-CnioHf5V.js → monitor-CFUAZhBS.js} +60 -33
- package/dist/runtime-api.js +4 -4
- package/dist/{session-mBuvPUCy.js → session-CoxlXm2K.js} +28 -7
- package/dist/{session.runtime-LZFdq3yb.js → session.runtime-CyooSQvj.js} +2 -3
- package/dist/{setup-core-B_mz0POD.js → setup-core-DLXi32yR.js} +3 -3
- package/dist/{setup-finalize-Ds1tCFvo.js → setup-finalize-B-g0GzHp.js} +2 -2
- package/dist/setup-plugin-api.js +1 -1
- package/dist/{setup-surface-BlvVtmwO.js → setup-surface-YtBXJFy0.js} +2 -2
- package/npm-shrinkwrap.json +3 -3
- package/package.json +4 -4
package/dist/api.js
CHANGED
|
@@ -4,16 +4,16 @@ import { a as normalizeWhatsAppAllowFromEntries, c as normalizeWhatsAppTarget, i
|
|
|
4
4
|
import { t as resolveWhatsAppOutboundTarget } from "./resolve-outbound-target-CcdugbDf.js";
|
|
5
5
|
import "./send-DSlVXKL_.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-Dk37KYHj.js";
|
|
7
|
-
import { n as WHATSAPP_LEGACY_OUTBOUND_SEND_DEP_KEYS, t as whatsappPlugin } from "./channel-
|
|
7
|
+
import { n as WHATSAPP_LEGACY_OUTBOUND_SEND_DEP_KEYS, t as whatsappPlugin } from "./channel-CK_4OwYn.js";
|
|
8
8
|
import { t as whatsappCommandPolicy } from "./command-policy-BIOSHySD.js";
|
|
9
|
-
import { a as resolveWhatsAppGroupRequireMention, o as resolveWhatsAppGroupToolPolicy, s as resolveWhatsAppGroupIntroHint } from "./setup-core-
|
|
9
|
+
import { a as resolveWhatsAppGroupRequireMention, o as resolveWhatsAppGroupToolPolicy, s as resolveWhatsAppGroupIntroHint } from "./setup-core-DLXi32yR.js";
|
|
10
10
|
import "./config-schema-CROZuhT-.js";
|
|
11
|
-
import { t as whatsappSetupPlugin } from "./channel.setup-
|
|
11
|
+
import { t as whatsappSetupPlugin } from "./channel.setup-I-zFGu02.js";
|
|
12
12
|
import { t as DEFAULT_WEB_MEDIA_BYTES } from "./constants-HU41RHGI.js";
|
|
13
13
|
import { n as listWhatsAppDirectoryGroupsFromConfig, r as listWhatsAppDirectoryPeersFromConfig } from "./directory-config-Dijefxc3.js";
|
|
14
14
|
import { n as testing } from "./access-control-C53zKYSN.js";
|
|
15
15
|
import { m as extractText, t as createWebSendApi } from "./send-api-Bjn-h80j.js";
|
|
16
|
-
import { r as waitForWaConnection, t as createWaSocket } from "./session-
|
|
16
|
+
import { r as waitForWaConnection, t as createWaSocket } from "./session-CoxlXm2K.js";
|
|
17
17
|
import "openclaw/plugin-sdk/channel-actions";
|
|
18
18
|
import "openclaw/plugin-sdk/account-resolution";
|
|
19
19
|
import "openclaw/plugin-sdk/core";
|
|
@@ -79,17 +79,11 @@ async function startWhatsAppQaDriverSession(params) {
|
|
|
79
79
|
closeSocket(sock);
|
|
80
80
|
};
|
|
81
81
|
sock.ev.on("messages.upsert", onMessagesUpsert);
|
|
82
|
-
let connectionTimeout;
|
|
83
82
|
try {
|
|
84
|
-
await
|
|
85
|
-
connectionTimeout = setTimeout(() => reject(/* @__PURE__ */ new Error("timed out waiting for WhatsApp QA driver session")), params.connectionTimeoutMs ?? 45e3);
|
|
86
|
-
connectionTimeout.unref?.();
|
|
87
|
-
})]);
|
|
83
|
+
await waitForWaConnection(sock, { timeoutMs: params.connectionTimeoutMs ?? 45e3 });
|
|
88
84
|
} catch (error) {
|
|
89
85
|
closeSessionResources(error instanceof Error ? error : /* @__PURE__ */ new Error("failed starting WhatsApp QA driver session"));
|
|
90
86
|
throw error;
|
|
91
|
-
} finally {
|
|
92
|
-
if (connectionTimeout) clearTimeout(connectionTimeout);
|
|
93
87
|
}
|
|
94
88
|
const sendApi = createWebSendApi({
|
|
95
89
|
sock,
|
|
@@ -15,7 +15,7 @@ const CREDS_FILE_MODE = 384;
|
|
|
15
15
|
const CREDS_SAVE_FLUSH_TIMEOUT_MS = 15e3;
|
|
16
16
|
const credsSaveQueues = /* @__PURE__ */ new Map();
|
|
17
17
|
async function stringifyCreds(creds) {
|
|
18
|
-
const { BufferJSON } = await import("./session.runtime-
|
|
18
|
+
const { BufferJSON } = await import("./session.runtime-CyooSQvj.js").then((n) => n.a);
|
|
19
19
|
return JSON.stringify(creds, BufferJSON.replacer);
|
|
20
20
|
}
|
|
21
21
|
async function writeWebCredsRawAtomically(params) {
|
|
@@ -9,8 +9,8 @@ import { p as toWhatsappJid } from "./text-runtime-Dk37KYHj.js";
|
|
|
9
9
|
import { t as createWhatsAppLoginTool } from "./agent-tools-login-BX7eHgDm.js";
|
|
10
10
|
import { i as lookupInboundMessageMetaForTarget } from "./quoted-message-CveINB35.js";
|
|
11
11
|
import { t as whatsappCommandPolicy } from "./command-policy-BIOSHySD.js";
|
|
12
|
-
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-
|
|
13
|
-
import { f as readWebAuthExistsForDecision, n as WHATSAPP_AUTH_UNSTABLE_CODE } from "./auth-store-
|
|
12
|
+
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-DLXi32yR.js";
|
|
13
|
+
import { f as readWebAuthExistsForDecision, n as WHATSAPP_AUTH_UNSTABLE_CODE } from "./auth-store-B2ZibndQ.js";
|
|
14
14
|
import { t as detectWhatsAppLegacyStateMigrations } from "./state-migrations-D_BmQUR9.js";
|
|
15
15
|
import { createActionGate as createActionGate$1 } from "openclaw/plugin-sdk/channel-actions";
|
|
16
16
|
import { DEFAULT_ACCOUNT_ID, listCombinedAccountIds, normalizeOptionalAccountId, resolveListedDefaultAccountId } from "openclaw/plugin-sdk/account-core";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as whatsappPlugin } from "./channel-
|
|
1
|
+
import { t as whatsappPlugin } from "./channel-CK_4OwYn.js";
|
|
2
2
|
export { whatsappPlugin };
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { startWebLoginWithQr as startWebLoginWithQr$1, waitForWebLogin as waitForWebLogin$1 } from "./login-qr-runtime.js";
|
|
2
|
-
import { c as logoutWeb$1, d as readWebAuthExistsBestEffort$1, f as readWebAuthExistsForDecision$1, g as readWebSelfId$1, h as readWebAuthState$1, m as readWebAuthSnapshotBestEffort$1, o as getWebAuthAgeMs$1, p as readWebAuthSnapshot$1, s as logWebSelfId$1, x as webAuthExists$1 } from "./auth-store-
|
|
2
|
+
import { c as logoutWeb$1, d as readWebAuthExistsBestEffort$1, f as readWebAuthExistsForDecision$1, g as readWebSelfId$1, h as readWebAuthState$1, m as readWebAuthSnapshotBestEffort$1, o as getWebAuthAgeMs$1, p as readWebAuthSnapshot$1, s as logWebSelfId$1, x as webAuthExists$1 } from "./auth-store-B2ZibndQ.js";
|
|
3
3
|
import { t as getActiveWebListener$1 } from "./active-listener-CFwkn3ho.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-CFUAZhBS.js";
|
|
5
|
+
import { t as loginWeb$1 } from "./login-Bflq347x.js";
|
|
6
|
+
import { whatsappSetupWizard as whatsappSetupWizard$1 } from "./setup-surface-YtBXJFy0.js";
|
|
7
7
|
//#region extensions/whatsapp/src/channel.runtime.ts
|
|
8
8
|
function getActiveWebListener(...args) {
|
|
9
9
|
return getActiveWebListener$1(...args);
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { a as resolveWhatsAppGroupRequireMention, i as whatsappSetupWizardProxy, n as createWhatsAppPluginBase, o as resolveWhatsAppGroupToolPolicy, s as resolveWhatsAppGroupIntroHint, t as whatsappSetupAdapter } from "./setup-core-
|
|
1
|
+
import { a as resolveWhatsAppGroupRequireMention, i as whatsappSetupWizardProxy, n as createWhatsAppPluginBase, o as resolveWhatsAppGroupToolPolicy, s as resolveWhatsAppGroupIntroHint, t as whatsappSetupAdapter } from "./setup-core-DLXi32yR.js";
|
|
2
2
|
import { t as detectWhatsAppLegacyStateMigrations } from "./state-migrations-D_BmQUR9.js";
|
|
3
3
|
//#region extensions/whatsapp/src/channel.setup.ts
|
|
4
4
|
async function isWhatsAppAuthConfigured(account) {
|
|
5
|
-
const { readWebAuthState } = await import("./auth-store-
|
|
5
|
+
const { readWebAuthState } = await import("./auth-store-B2ZibndQ.js").then((n) => n.i);
|
|
6
6
|
return await readWebAuthState(account.authDir) === "linked";
|
|
7
7
|
}
|
|
8
8
|
const whatsappSetupPlugin = {
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import { a as unregisterWhatsAppConnectionController, i as registerWhatsAppConnectionController, n as getStatusCode, t as formatError } from "./session-errors-CbsoQqoy.js";
|
|
2
|
-
import { c as logoutWeb } from "./auth-store-
|
|
3
|
-
import { r as waitForWaConnection, t as createWaSocket } from "./session-
|
|
2
|
+
import { c as logoutWeb } from "./auth-store-B2ZibndQ.js";
|
|
3
|
+
import { i as DEFAULT_WHATSAPP_SOCKET_TIMING, r as waitForWaConnection, t as createWaSocket } from "./session-CoxlXm2K.js";
|
|
4
4
|
import { computeBackoff, info, sleepWithAbort } from "openclaw/plugin-sdk/runtime-env";
|
|
5
5
|
import { clamp } from "openclaw/plugin-sdk/text-utility-runtime";
|
|
6
|
-
import { DisconnectReason } from "baileys";
|
|
7
6
|
import { randomUUID } from "node:crypto";
|
|
8
7
|
const DEFAULT_RECONNECT_POLICY = {
|
|
9
8
|
initialMs: 2e3,
|
|
@@ -37,9 +36,9 @@ function newConnectionId() {
|
|
|
37
36
|
}
|
|
38
37
|
//#endregion
|
|
39
38
|
//#region extensions/whatsapp/src/connection-controller.ts
|
|
40
|
-
const LOGGED_OUT_STATUS =
|
|
39
|
+
const LOGGED_OUT_STATUS = 401;
|
|
41
40
|
const POST_PAIRING_RESTART_STATUS = 515;
|
|
42
|
-
const TIMED_OUT_STATUS =
|
|
41
|
+
const TIMED_OUT_STATUS = 408;
|
|
43
42
|
const WHATSAPP_LOGIN_RESTART_MESSAGE = "WhatsApp asked for a restart after pairing (code 515); waiting for creds to save…";
|
|
44
43
|
const WHATSAPP_LOGIN_TIMEOUT_RESTART_MESSAGE = "WhatsApp connection timed out before login; retrying with a fresh socket…";
|
|
45
44
|
const WHATSAPP_LOGGED_OUT_RELINK_MESSAGE = "WhatsApp reported the session is logged out. Cleared cached web session; please rerun openclaw channels login and scan the QR again.";
|
|
@@ -105,7 +104,7 @@ async function waitForWhatsAppLoginResult(params) {
|
|
|
105
104
|
let postPairingRestarted = false;
|
|
106
105
|
let timeoutRestarted = false;
|
|
107
106
|
while (true) try {
|
|
108
|
-
await wait(currentSock);
|
|
107
|
+
await wait(currentSock, { timeout: "none" });
|
|
109
108
|
return {
|
|
110
109
|
outcome: "connected",
|
|
111
110
|
restarted: postPairingRestarted || timeoutRestarted,
|
|
@@ -176,7 +175,10 @@ var WhatsAppConnectionController = class {
|
|
|
176
175
|
this.abortSignal = params.abortSignal;
|
|
177
176
|
this.sleep = params.sleep ?? ((ms, signal) => sleepWithAbort(ms, signal));
|
|
178
177
|
this.isNonRetryableStatus = params.isNonRetryableStatus ?? (() => false);
|
|
179
|
-
this.socketTiming =
|
|
178
|
+
this.socketTiming = {
|
|
179
|
+
...DEFAULT_WHATSAPP_SOCKET_TIMING,
|
|
180
|
+
...params.socketTiming
|
|
181
|
+
};
|
|
180
182
|
this.socketRef = { current: null };
|
|
181
183
|
this.abortPromise = params.abortSignal && new Promise((resolve) => {
|
|
182
184
|
params.abortSignal?.addEventListener("abort", () => resolve("aborted"), { once: true });
|
|
@@ -240,7 +242,7 @@ var WhatsAppConnectionController = class {
|
|
|
240
242
|
authDir: this.authDir,
|
|
241
243
|
...this.socketTiming
|
|
242
244
|
});
|
|
243
|
-
await waitForWaConnection(sock);
|
|
245
|
+
await waitForWaConnection(sock, { timeoutMs: this.socketTiming.connectTimeoutMs });
|
|
244
246
|
this.socketRef.current = sock;
|
|
245
247
|
connection = createLiveConnection({
|
|
246
248
|
connectionId: params.connectionId,
|
|
@@ -325,6 +327,15 @@ var WhatsAppConnectionController = class {
|
|
|
325
327
|
normalized
|
|
326
328
|
};
|
|
327
329
|
}
|
|
330
|
+
resolveSetupErrorDecision(error) {
|
|
331
|
+
const statusCode = getStatusCode(error);
|
|
332
|
+
if (typeof statusCode !== "number") return null;
|
|
333
|
+
return this.resolveCloseDecision({
|
|
334
|
+
status: statusCode,
|
|
335
|
+
isLoggedOut: statusCode === LOGGED_OUT_STATUS,
|
|
336
|
+
error
|
|
337
|
+
});
|
|
338
|
+
}
|
|
328
339
|
consumeReconnectAttempt() {
|
|
329
340
|
this.reconnectAttempts += 1;
|
|
330
341
|
if (this.reconnectPolicy.maxAttempts > 0 && this.reconnectAttempts >= this.reconnectPolicy.maxAttempts) return {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { n as getStatusCode, t as formatError } from "./session-errors-CbsoQqoy.js";
|
|
2
2
|
import { t as createWhatsAppLoginTool } from "./agent-tools-login-BX7eHgDm.js";
|
|
3
|
-
import { c as logoutWeb, g as readWebSelfId, l as pickWebChannel, o as getWebAuthAgeMs, s as logWebSelfId, t as WA_WEB_AUTH_DIR, x as webAuthExists, y as resolveDefaultWebAuthDir } from "./auth-store-
|
|
3
|
+
import { c as logoutWeb, g as readWebSelfId, l as pickWebChannel, o as getWebAuthAgeMs, s as logWebSelfId, t as WA_WEB_AUTH_DIR, x as webAuthExists, y as resolveDefaultWebAuthDir } from "./auth-store-B2ZibndQ.js";
|
|
4
4
|
import { t as getActiveWebListener } from "./active-listener-CFwkn3ho.js";
|
|
5
5
|
export { WA_WEB_AUTH_DIR, createWhatsAppLoginTool, formatError, getActiveWebListener, getStatusCode, getWebAuthAgeMs, logWebSelfId, logoutWeb, pickWebChannel, readWebSelfId, resolveDefaultWebAuthDir, webAuthExists };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { t as __exportAll } from "./rolldown-runtime-D7D4PA-g.js";
|
|
2
2
|
import { a as resolveWhatsAppAccount } from "./accounts-DgViSyJx.js";
|
|
3
|
-
import { b as restoreCredsFromBackupIfNeeded } from "./auth-store-
|
|
4
|
-
import { a as
|
|
5
|
-
import { a as closeWaSocketSoon, o as waitForWhatsAppLoginResult } from "./connection-controller-
|
|
3
|
+
import { b as restoreCredsFromBackupIfNeeded } from "./auth-store-B2ZibndQ.js";
|
|
4
|
+
import { a as resolveWhatsAppSocketTiming, o as renderQrTerminal, t as createWaSocket } from "./session-CoxlXm2K.js";
|
|
5
|
+
import { a as closeWaSocketSoon, o as waitForWhatsAppLoginResult } from "./connection-controller-BnRkIjlP.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-DgViSyJx.js";
|
|
2
|
-
import { f as readWebAuthExistsForDecision, g as readWebSelfId, n as WHATSAPP_AUTH_UNSTABLE_CODE } from "./auth-store-
|
|
3
|
-
import {
|
|
4
|
-
import { i as closeWaSocket, o as waitForWhatsAppLoginResult, t as WHATSAPP_LOGGED_OUT_QR_MESSAGE } from "./connection-controller-
|
|
2
|
+
import { f as readWebAuthExistsForDecision, g as readWebSelfId, n as WHATSAPP_AUTH_UNSTABLE_CODE } from "./auth-store-B2ZibndQ.js";
|
|
3
|
+
import { a as resolveWhatsAppSocketTiming, t as createWaSocket } from "./session-CoxlXm2K.js";
|
|
4
|
+
import { i as closeWaSocket, o as waitForWhatsAppLoginResult, t as WHATSAPP_LOGGED_OUT_QR_MESSAGE } from "./connection-controller-BnRkIjlP.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-CHWzkQq4.js");
|
|
5
5
|
return loginQrModulePromise;
|
|
6
6
|
}
|
|
7
7
|
async function startWebLoginWithQr(...args) {
|
|
@@ -5,14 +5,14 @@ import { n as getWhatsAppRuntime } from "./runtime-BfAdAEYT.js";
|
|
|
5
5
|
import { n as getStatusCode, t as formatError } from "./session-errors-CbsoQqoy.js";
|
|
6
6
|
import { d as markdownToWhatsApp, f as resolveJidToE164, l as isSelfChatMode, n as normalizeE164, t as convertMarkdownTables$1, u as jidToE164 } from "./text-runtime-Dk37KYHj.js";
|
|
7
7
|
import { n as cacheInboundMessageMeta, r as lookupInboundMessageMeta, t as buildQuotedMessageOptions } from "./quoted-message-CveINB35.js";
|
|
8
|
-
import { c as logoutWeb, g as readWebSelfId, o as getWebAuthAgeMs, r as WhatsAppAuthUnstableError, v as readWebSelfIdentityForDecision } from "./auth-store-
|
|
8
|
+
import { c as logoutWeb, g as readWebSelfId, o as getWebAuthAgeMs, r as WhatsAppAuthUnstableError, v as readWebSelfIdentityForDecision } from "./auth-store-B2ZibndQ.js";
|
|
9
9
|
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-xoLLdqEv.js";
|
|
10
10
|
import { n as resolveWhatsAppGroupsConfigPath } from "./group-config-path-BGyzT9Lg.js";
|
|
11
11
|
import { i as resolveWhatsAppInboundPolicy, r as resolveWhatsAppCommandAuthorized, t as checkInboundAccessControl } from "./access-control-C53zKYSN.js";
|
|
12
12
|
import { a as mayContainWhatsAppOutboundMention, c as describeReplyContext, d as extractLocationData, f as extractMediaPlaceholder, h as hasInboundUserContent, i as addWhatsAppOutboundMentionsToContent, l as extractContactContext, m as extractText, n as listWhatsAppSendResultMessageIds, o as resolveWhatsAppOutboundMentions, p as extractMentionedJids, r as normalizeWhatsAppSendResult, s as addWhatsAppImagePreviewFields, t as createWebSendApi, u as extractContextInfo } from "./send-api-Bjn-h80j.js";
|
|
13
|
-
import {
|
|
14
|
-
import { t as BufferJSON } from "./session.runtime-
|
|
15
|
-
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 { a as resolveWhatsAppSocketTiming, r as waitForWaConnection, t as createWaSocket } from "./session-CoxlXm2K.js";
|
|
14
|
+
import { t as BufferJSON } from "./session.runtime-CyooSQvj.js";
|
|
15
|
+
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-BnRkIjlP.js";
|
|
16
16
|
import { resolveAccountEntry } from "openclaw/plugin-sdk/account-core";
|
|
17
17
|
import { normalizeLowercaseStringOrEmpty, normalizeStringEntries, uniqueStrings } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
18
18
|
import { createChannelMessageReplyPipeline, createDurableInboundReceiveJournalFromQueue, createMessageReceiptFromOutboundResults, deliverInboundReplyWithMessageSendContext, resolveChannelMessageSourceReplyDeliveryMode } from "openclaw/plugin-sdk/channel-outbound";
|
|
@@ -30,7 +30,7 @@ import { DEFAULT_ACCOUNT_ID as DEFAULT_ACCOUNT_ID$1, DEFAULT_MAIN_KEY, buildAgen
|
|
|
30
30
|
import { asDateTimestampMs, parseStrictFiniteNumber, resolveExpiresAtMsFromDurationMs } from "openclaw/plugin-sdk/number-runtime";
|
|
31
31
|
import { recordInboundSession } from "openclaw/plugin-sdk/conversation-runtime";
|
|
32
32
|
import { loadSessionStore, resolveStorePath, updateLastRoute, updateSessionStore } from "openclaw/plugin-sdk/session-store-runtime";
|
|
33
|
-
import { DisconnectReason
|
|
33
|
+
import { DisconnectReason, downloadMediaMessage, isJidGroup, normalizeMessageContent as normalizeMessageContent$1 } from "baileys";
|
|
34
34
|
import { buildChannelInboundEventContext, filterChannelInboundQuoteContext, formatInboundEnvelope, formatInboundEnvelope as formatInboundEnvelope$1, formatLocationText, hasVisibleInboundReplyDispatch, resolveInboundSessionEnvelopeContext, runChannelInboundEvent, toInboundMediaFacts, toLocationContext } from "openclaw/plugin-sdk/channel-inbound";
|
|
35
35
|
import { recordChannelActivity } from "openclaw/plugin-sdk/channel-activity-runtime";
|
|
36
36
|
import { createHash } from "node:crypto";
|
|
@@ -259,7 +259,7 @@ async function downloadQuotedInboundMedia(msg, sock, maxBytes = 50 * 1024 * 1024
|
|
|
259
259
|
}
|
|
260
260
|
//#endregion
|
|
261
261
|
//#region extensions/whatsapp/src/inbound/monitor.ts
|
|
262
|
-
const LOGGED_OUT_STATUS = DisconnectReason
|
|
262
|
+
const LOGGED_OUT_STATUS = DisconnectReason?.loggedOut ?? 401;
|
|
263
263
|
const RECONNECT_IN_PROGRESS_ERROR = "no active socket - reconnection in progress";
|
|
264
264
|
const GROUP_META_TTL_MS = 300 * 1e3;
|
|
265
265
|
const INBOUND_CLOSE_DRAIN_TIMEOUT_MS = 5e3;
|
|
@@ -997,11 +997,17 @@ async function attachWebInboxToSocket(options) {
|
|
|
997
997
|
};
|
|
998
998
|
}
|
|
999
999
|
async function monitorWebInbox(options) {
|
|
1000
|
+
const socketTiming = resolveWhatsAppSocketTiming(options.cfg);
|
|
1000
1001
|
const sock = await createWaSocket(false, options.verbose, {
|
|
1001
1002
|
authDir: options.authDir,
|
|
1002
|
-
...
|
|
1003
|
+
...socketTiming
|
|
1003
1004
|
});
|
|
1004
|
-
|
|
1005
|
+
try {
|
|
1006
|
+
await waitForWaConnection(sock, { timeoutMs: socketTiming.connectTimeoutMs });
|
|
1007
|
+
} catch (err) {
|
|
1008
|
+
closeInboundMonitorSocket(sock);
|
|
1009
|
+
throw err;
|
|
1010
|
+
}
|
|
1005
1011
|
return attachWebInboxToSocket({
|
|
1006
1012
|
...options,
|
|
1007
1013
|
sock
|
|
@@ -2234,7 +2240,7 @@ async function dispatchWhatsAppBufferedReply(params) {
|
|
|
2234
2240
|
return await deliverNormalizedPayload(pending.payload, pending.info);
|
|
2235
2241
|
} });
|
|
2236
2242
|
if (statusReactionController) statusReactionController.setThinking();
|
|
2237
|
-
const
|
|
2243
|
+
const dispatchResult = await dispatchReplyWithBufferedBlockDispatcher({
|
|
2238
2244
|
ctx: params.context,
|
|
2239
2245
|
cfg: params.cfg,
|
|
2240
2246
|
replyResolver: params.replyResolver,
|
|
@@ -2355,10 +2361,9 @@ async function dispatchWhatsAppBufferedReply(params) {
|
|
|
2355
2361
|
} } : {}
|
|
2356
2362
|
}
|
|
2357
2363
|
});
|
|
2358
|
-
|
|
2359
|
-
|
|
2360
|
-
|
|
2361
|
-
})) {
|
|
2364
|
+
const didQueueVisibleReply = hasVisibleInboundReplyDispatch(dispatchResult);
|
|
2365
|
+
const didDeliverVisibleReply = didSendReply || dispatchResult.observedReplyDelivery === true;
|
|
2366
|
+
if (!didQueueVisibleReply) {
|
|
2362
2367
|
if (statusReactionController) finalizeWhatsAppStatusReaction({
|
|
2363
2368
|
controller: statusReactionController,
|
|
2364
2369
|
outcome: "error",
|
|
@@ -2372,13 +2377,13 @@ async function dispatchWhatsAppBufferedReply(params) {
|
|
|
2372
2377
|
}
|
|
2373
2378
|
if (statusReactionController) finalizeWhatsAppStatusReaction({
|
|
2374
2379
|
controller: statusReactionController,
|
|
2375
|
-
outcome:
|
|
2376
|
-
hasFinalResponse:
|
|
2380
|
+
outcome: didDeliverVisibleReply ? "done" : "error",
|
|
2381
|
+
hasFinalResponse: didDeliverVisibleReply,
|
|
2377
2382
|
removeAckAfterReply,
|
|
2378
2383
|
timing: statusReactionTiming
|
|
2379
2384
|
});
|
|
2380
2385
|
if (params.shouldClearGroupHistory) params.groupHistories.set(params.groupHistoryKey, []);
|
|
2381
|
-
return
|
|
2386
|
+
return didDeliverVisibleReply;
|
|
2382
2387
|
}
|
|
2383
2388
|
async function finalizeWhatsAppStatusReaction(params) {
|
|
2384
2389
|
if (params.outcome === "done") {
|
|
@@ -3321,35 +3326,57 @@ async function monitorWebChannel(verbose, listenerFactory = attachWebInboxToSock
|
|
|
3321
3326
|
}
|
|
3322
3327
|
});
|
|
3323
3328
|
} catch (error) {
|
|
3324
|
-
|
|
3325
|
-
|
|
3326
|
-
|
|
3329
|
+
const setupDecision = controller.resolveSetupErrorDecision(error);
|
|
3330
|
+
if (setupDecision === "aborted") {
|
|
3331
|
+
await controller.shutdown();
|
|
3332
|
+
break;
|
|
3333
|
+
}
|
|
3334
|
+
if (setupDecision) {
|
|
3335
|
+
statusController.noteReconnectAttempts(setupDecision.reconnectAttempts);
|
|
3327
3336
|
statusController.noteClose({
|
|
3328
|
-
statusCode:
|
|
3337
|
+
statusCode: setupDecision.normalized.statusCode,
|
|
3329
3338
|
error: formatError(error),
|
|
3330
|
-
reconnectAttempts:
|
|
3331
|
-
healthState:
|
|
3339
|
+
reconnectAttempts: setupDecision.reconnectAttempts,
|
|
3340
|
+
healthState: setupDecision.healthState
|
|
3332
3341
|
});
|
|
3333
|
-
if (
|
|
3342
|
+
if (setupDecision.action === "stop") {
|
|
3334
3343
|
reconnectLogger.warn({
|
|
3335
3344
|
connectionId,
|
|
3336
|
-
status:
|
|
3337
|
-
reconnectAttempts:
|
|
3345
|
+
status: setupDecision.normalized.statusLabel,
|
|
3346
|
+
reconnectAttempts: setupDecision.reconnectAttempts,
|
|
3338
3347
|
maxAttempts: reconnectPolicy.maxAttempts
|
|
3339
|
-
}, "web reconnect:
|
|
3340
|
-
|
|
3348
|
+
}, "web reconnect: setup status error; max attempts reached");
|
|
3349
|
+
if (setupDecision.healthState === "logged-out") {
|
|
3350
|
+
await clearTerminalWebAuthState({
|
|
3351
|
+
account,
|
|
3352
|
+
runtime,
|
|
3353
|
+
statusLabel: setupDecision.normalized.statusLabel,
|
|
3354
|
+
healthState: setupDecision.healthState,
|
|
3355
|
+
log: reconnectLogger
|
|
3356
|
+
});
|
|
3357
|
+
runtime.error(`WhatsApp session logged out during setup. Run \`${formatCliCommand("openclaw channels login --channel whatsapp")}\` to relink.`);
|
|
3358
|
+
} else if (setupDecision.healthState === "conflict") {
|
|
3359
|
+
await clearTerminalWebAuthState({
|
|
3360
|
+
account,
|
|
3361
|
+
runtime,
|
|
3362
|
+
statusLabel: setupDecision.normalized.statusLabel,
|
|
3363
|
+
healthState: setupDecision.healthState,
|
|
3364
|
+
log: reconnectLogger
|
|
3365
|
+
});
|
|
3366
|
+
runtime.error(`WhatsApp Web connection closed during setup (status ${setupDecision.normalized.statusLabel}: session conflict). Resolve conflicting WhatsApp Web sessions, then relink with \`${formatCliCommand("openclaw channels login --channel whatsapp")}\`. Stopping web monitoring.`);
|
|
3367
|
+
} else runtime.error(`WhatsApp Web connection closed during setup (status ${setupDecision.normalized.statusLabel}) after ${setupDecision.reconnectAttempts}/${reconnectPolicy.maxAttempts} attempts. Relink with \`${formatCliCommand("openclaw channels login --channel whatsapp")}\` if the issue persists.`);
|
|
3341
3368
|
await controller.shutdown();
|
|
3342
3369
|
break;
|
|
3343
3370
|
}
|
|
3344
3371
|
reconnectLogger.info({
|
|
3345
3372
|
connectionId,
|
|
3346
|
-
status:
|
|
3347
|
-
reconnectAttempts:
|
|
3348
|
-
delayMs:
|
|
3349
|
-
}, "web reconnect:
|
|
3350
|
-
runtime.error(`WhatsApp Web connection closed during setup (status
|
|
3373
|
+
status: setupDecision.normalized.statusLabel,
|
|
3374
|
+
reconnectAttempts: setupDecision.reconnectAttempts,
|
|
3375
|
+
delayMs: setupDecision.delayMs
|
|
3376
|
+
}, "web reconnect: setup status error; retrying");
|
|
3377
|
+
runtime.error(`WhatsApp Web connection closed during setup (status ${setupDecision.normalized.statusLabel}). Retry ${setupDecision.reconnectAttempts}/${reconnectPolicy.maxAttempts || "∞"} in ${formatDurationPrecise(setupDecision.delayMs ?? 0)}.`);
|
|
3351
3378
|
try {
|
|
3352
|
-
await controller.waitBeforeRetry(
|
|
3379
|
+
await controller.waitBeforeRetry(setupDecision.delayMs ?? 0);
|
|
3353
3380
|
} catch {
|
|
3354
3381
|
break;
|
|
3355
3382
|
}
|
package/dist/runtime-api.js
CHANGED
|
@@ -5,12 +5,12 @@ import { r as setWhatsAppRuntime } from "./runtime-BfAdAEYT.js";
|
|
|
5
5
|
import { n as getStatusCode, t as formatError } from "./session-errors-CbsoQqoy.js";
|
|
6
6
|
import { startWebLoginWithQr, waitForWebLogin } from "./login-qr-runtime.js";
|
|
7
7
|
import { t as createWhatsAppLoginTool } from "./agent-tools-login-BX7eHgDm.js";
|
|
8
|
-
import { C as waitForCredsSaveQueue, T as writeCredsJsonAtomically, _ as readWebSelfIdentity, a as formatWhatsAppWebAuthStatusState, b as restoreCredsFromBackupIfNeeded, c as logoutWeb, d as readWebAuthExistsBestEffort, f as readWebAuthExistsForDecision, g as readWebSelfId, h as readWebAuthState, l as pickWebChannel, m as readWebAuthSnapshotBestEffort, n as WHATSAPP_AUTH_UNSTABLE_CODE, o as getWebAuthAgeMs, p as readWebAuthSnapshot, r as WhatsAppAuthUnstableError, s as logWebSelfId, t as WA_WEB_AUTH_DIR, u as readCredsJsonRaw, v as readWebSelfIdentityForDecision, w as waitForCredsSaveQueueWithTimeout, x as webAuthExists, y as resolveDefaultWebAuthDir } from "./auth-store-
|
|
8
|
+
import { C as waitForCredsSaveQueue, T as writeCredsJsonAtomically, _ as readWebSelfIdentity, a as formatWhatsAppWebAuthStatusState, b as restoreCredsFromBackupIfNeeded, c as logoutWeb, d as readWebAuthExistsBestEffort, f as readWebAuthExistsForDecision, g as readWebSelfId, h as readWebAuthState, l as pickWebChannel, m as readWebAuthSnapshotBestEffort, n as WHATSAPP_AUTH_UNSTABLE_CODE, o as getWebAuthAgeMs, p as readWebAuthSnapshot, r as WhatsAppAuthUnstableError, s as logWebSelfId, t as WA_WEB_AUTH_DIR, u as readCredsJsonRaw, v as readWebSelfIdentityForDecision, w as waitForCredsSaveQueueWithTimeout, x as webAuthExists, y as resolveDefaultWebAuthDir } from "./auth-store-B2ZibndQ.js";
|
|
9
9
|
import { t as DEFAULT_WEB_MEDIA_BYTES } from "./constants-HU41RHGI.js";
|
|
10
10
|
import { d as extractLocationData, f as extractMediaPlaceholder, l as extractContactContext, m as extractText } from "./send-api-Bjn-h80j.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-CoxlXm2K.js";
|
|
12
12
|
import { n as resolveWebAccountId, t as getActiveWebListener } from "./active-listener-CFwkn3ho.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-CFUAZhBS.js";
|
|
14
|
+
import { t as loginWeb } from "./login-Bflq347x.js";
|
|
15
15
|
import { HEARTBEAT_PROMPT, HEARTBEAT_TOKEN, SILENT_REPLY_TOKEN, stripHeartbeatToken } from "openclaw/plugin-sdk/reply-runtime";
|
|
16
16
|
export { DEFAULT_WEB_MEDIA_BYTES, HEARTBEAT_PROMPT, HEARTBEAT_TOKEN, LocalMediaAccessError, SILENT_REPLY_TOKEN, WA_WEB_AUTH_DIR, WHATSAPP_AUTH_UNSTABLE_CODE, WhatsAppAuthUnstableError, createWaSocket, createWhatsAppLoginTool, extractContactContext, extractLocationData, extractMediaPlaceholder, extractText, formatError, formatWhatsAppWebAuthStatusState, getActiveWebListener, getDefaultLocalRoots, getStatusCode, getWebAuthAgeMs, handleWhatsAppAction, hasWebCredsSync, loadWebMedia, loadWebMediaRaw, logWebSelfId, loginWeb, logoutWeb, monitorWebChannel, monitorWebInbox, newConnectionId, optimizeImageToJpeg, optimizeImageToPng, pickWebChannel, readCredsJsonRaw, readWebAuthExistsBestEffort, readWebAuthExistsForDecision, readWebAuthSnapshot, readWebAuthSnapshotBestEffort, readWebAuthState, readWebSelfId, readWebSelfIdentity, readWebSelfIdentityForDecision, resetWebInboundDedupe, resolveDefaultWebAuthDir, resolveWebAccountId, resolveWebCredsBackupPath, resolveWebCredsPath, restoreCredsFromBackupIfNeeded, sendMessageWhatsApp, sendPollWhatsApp, sendReactionWhatsApp, sendTypingWhatsApp, setWhatsAppRuntime, startWebLoginWithQr, stripHeartbeatToken, waitForCredsSaveQueue, waitForCredsSaveQueueWithTimeout, waitForWaConnection, waitForWebLogin, webAuthExists, whatsAppActionRuntime, writeCredsJsonAtomically };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { o as resolveWebCredsBackupPath, s as resolveWebCredsPath, t as assertWebCredsPathRegularFileOrMissing } from "./creds-files-B1kSWtBg.js";
|
|
2
2
|
import { n as getStatusCode } from "./session-errors-CbsoQqoy.js";
|
|
3
|
-
import { E as writeWebCredsRawAtomically, S as enqueueCredsSave, T as writeCredsJsonAtomically, b as restoreCredsFromBackupIfNeeded, u as readCredsJsonRaw, w as waitForCredsSaveQueueWithTimeout, y as resolveDefaultWebAuthDir } from "./auth-store-
|
|
4
|
-
import {
|
|
3
|
+
import { E as writeWebCredsRawAtomically, S as enqueueCredsSave, T as writeCredsJsonAtomically, b as restoreCredsFromBackupIfNeeded, u as readCredsJsonRaw, w as waitForCredsSaveQueueWithTimeout, y as resolveDefaultWebAuthDir } from "./auth-store-B2ZibndQ.js";
|
|
4
|
+
import { i as makeWASocket, n as fetchLatestBaileysVersion, o as useMultiFileAuthState, r as makeCacheableSignalKeyStore } from "./session.runtime-CyooSQvj.js";
|
|
5
5
|
import { VERSION, formatCliCommand } from "openclaw/plugin-sdk/cli-runtime";
|
|
6
6
|
import { danger, getChildLogger, success, toPinoLikeLogger } from "openclaw/plugin-sdk/runtime-env";
|
|
7
7
|
import { renderQrTerminal } from "openclaw/plugin-sdk/media-runtime";
|
|
@@ -27,7 +27,7 @@ function resolveWhatsAppSocketTiming(cfg, overrides) {
|
|
|
27
27
|
}
|
|
28
28
|
//#endregion
|
|
29
29
|
//#region extensions/whatsapp/src/session.ts
|
|
30
|
-
const LOGGED_OUT_STATUS =
|
|
30
|
+
const LOGGED_OUT_STATUS = 401;
|
|
31
31
|
const WHATSAPP_WEBSOCKET_PROXY_TARGET = "https://mmg.whatsapp.net/";
|
|
32
32
|
const CREDS_FLUSH_TIMEOUT_MESSAGE = "Queued WhatsApp creds save did not finish before auth bootstrap; skipping repair and continuing with primary creds.";
|
|
33
33
|
async function rejectUnsafeWebCredsPath(authDir) {
|
|
@@ -185,21 +185,37 @@ function normalizeEnvProxyValue(value) {
|
|
|
185
185
|
const trimmed = value.trim();
|
|
186
186
|
return trimmed.length > 0 ? trimmed : null;
|
|
187
187
|
}
|
|
188
|
-
async function waitForWaConnection(sock) {
|
|
188
|
+
async function waitForWaConnection(sock, options = { timeout: "none" }) {
|
|
189
189
|
return new Promise((resolve, reject) => {
|
|
190
190
|
const evWithOff = sock.ev;
|
|
191
|
+
let timer;
|
|
192
|
+
const cleanup = () => {
|
|
193
|
+
evWithOff.off?.("connection.update", handler);
|
|
194
|
+
if (timer) {
|
|
195
|
+
clearTimeout(timer);
|
|
196
|
+
timer = void 0;
|
|
197
|
+
}
|
|
198
|
+
};
|
|
191
199
|
const handler = (...args) => {
|
|
192
200
|
const update = args[0] ?? {};
|
|
193
201
|
if (update.connection === "open") {
|
|
194
|
-
|
|
202
|
+
cleanup();
|
|
195
203
|
resolve();
|
|
196
204
|
}
|
|
197
205
|
if (update.connection === "close") {
|
|
198
|
-
|
|
206
|
+
cleanup();
|
|
199
207
|
reject(toLintErrorObject(update.lastDisconnect ?? /* @__PURE__ */ new Error("Connection closed"), "Non-Error rejection"));
|
|
200
208
|
}
|
|
201
209
|
};
|
|
202
210
|
sock.ev.on("connection.update", handler);
|
|
211
|
+
if ("timeoutMs" in options) {
|
|
212
|
+
const timeoutMs = options.timeoutMs;
|
|
213
|
+
timer = setTimeout(() => {
|
|
214
|
+
cleanup();
|
|
215
|
+
reject(createConnectionTimeoutError(timeoutMs));
|
|
216
|
+
}, timeoutMs);
|
|
217
|
+
timer.unref?.();
|
|
218
|
+
}
|
|
203
219
|
});
|
|
204
220
|
}
|
|
205
221
|
function newConnectionId() {
|
|
@@ -212,5 +228,10 @@ function toLintErrorObject(value, fallbackMessage) {
|
|
|
212
228
|
if (typeof value === "object" && value !== null || typeof value === "function") Object.assign(error, value);
|
|
213
229
|
return error;
|
|
214
230
|
}
|
|
231
|
+
function createConnectionTimeoutError(timeoutMs) {
|
|
232
|
+
const error = /* @__PURE__ */ new Error(`WhatsApp connection timed out after ${timeoutMs}ms`);
|
|
233
|
+
Object.assign(error, { output: { statusCode: 408 } });
|
|
234
|
+
return error;
|
|
235
|
+
}
|
|
215
236
|
//#endregion
|
|
216
|
-
export {
|
|
237
|
+
export { resolveWhatsAppSocketTiming as a, DEFAULT_WHATSAPP_SOCKET_TIMING as i, newConnectionId as n, renderQrTerminal as o, waitForWaConnection as r, createWaSocket as t };
|
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
import { t as __exportAll } from "./rolldown-runtime-D7D4PA-g.js";
|
|
2
|
-
import { BufferJSON,
|
|
2
|
+
import { BufferJSON, fetchLatestBaileysVersion, makeCacheableSignalKeyStore, makeWASocket, useMultiFileAuthState } from "baileys";
|
|
3
3
|
//#region extensions/whatsapp/src/session.runtime.ts
|
|
4
4
|
var session_runtime_exports = /* @__PURE__ */ __exportAll({
|
|
5
5
|
BufferJSON: () => BufferJSON,
|
|
6
|
-
DisconnectReason: () => DisconnectReason$1,
|
|
7
6
|
fetchLatestBaileysVersion: () => fetchLatestBaileysVersion,
|
|
8
7
|
makeCacheableSignalKeyStore: () => makeCacheableSignalKeyStore,
|
|
9
8
|
makeWASocket: () => makeWASocket,
|
|
10
9
|
useMultiFileAuthState: () => useMultiFileAuthState
|
|
11
10
|
});
|
|
12
11
|
//#endregion
|
|
13
|
-
export {
|
|
12
|
+
export { session_runtime_exports as a, makeWASocket as i, fetchLatestBaileysVersion as n, useMultiFileAuthState as o, makeCacheableSignalKeyStore as r, BufferJSON as t };
|
|
@@ -99,10 +99,10 @@ async function applyWhatsAppSecurityConfigFixes(params) {
|
|
|
99
99
|
//#region extensions/whatsapp/src/shared.ts
|
|
100
100
|
const WHATSAPP_CHANNEL = "whatsapp";
|
|
101
101
|
async function loadWhatsAppChannelRuntime() {
|
|
102
|
-
return await import("./channel.runtime-
|
|
102
|
+
return await import("./channel.runtime-DIAo-4Bj.js");
|
|
103
103
|
}
|
|
104
104
|
async function loadWhatsAppSetupSurface() {
|
|
105
|
-
return await import("./setup-surface-
|
|
105
|
+
return await import("./setup-surface-YtBXJFy0.js");
|
|
106
106
|
}
|
|
107
107
|
const whatsappSetupWizardProxy = createWhatsAppSetupWizardProxy(async () => (await loadWhatsAppSetupSurface()).whatsappSetupWizard);
|
|
108
108
|
const whatsappConfigAdapter = createScopedChannelConfigAdapter({
|
|
@@ -227,7 +227,7 @@ function createWhatsAppPluginBase(params) {
|
|
|
227
227
|
} }
|
|
228
228
|
},
|
|
229
229
|
reload: {
|
|
230
|
-
configPrefixes: ["web"],
|
|
230
|
+
configPrefixes: ["web", "channels.whatsapp.accounts"],
|
|
231
231
|
noopPrefixes: ["channels.whatsapp"]
|
|
232
232
|
},
|
|
233
233
|
gatewayMethodDescriptors: [{ name: "web.login.start" }, { name: "web.login.wait" }],
|
|
@@ -2,7 +2,7 @@ import { r as resolveDefaultWhatsAppAccountId } from "./account-ids-CB5SOWjc.js"
|
|
|
2
2
|
import { r as hasWebCredsSync } from "./creds-files-B1kSWtBg.js";
|
|
3
3
|
import { a as resolveWhatsAppAccount, o as resolveWhatsAppAuthDir } from "./accounts-DgViSyJx.js";
|
|
4
4
|
import { a as normalizeWhatsAppAllowFromEntries, o as normalizeWhatsAppAllowFromEntry } from "./normalize-target-bVWjgftN.js";
|
|
5
|
-
import { t as whatsappSetupAdapter } from "./setup-core-
|
|
5
|
+
import { t as whatsappSetupAdapter } from "./setup-core-DLXi32yR.js";
|
|
6
6
|
import { DEFAULT_ACCOUNT_ID, createSetupTranslator, 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
|
|
@@ -280,7 +280,7 @@ async function finalizeWhatsAppSetup(params) {
|
|
|
280
280
|
message: linked ? t("wizard.whatsapp.relinkPrompt") : t("wizard.whatsapp.linkNowPrompt"),
|
|
281
281
|
initialValue: !linked
|
|
282
282
|
})) try {
|
|
283
|
-
const { loginWeb } = await import("./login-
|
|
283
|
+
const { loginWeb } = await import("./login-Bflq347x.js").then((n) => n.n);
|
|
284
284
|
await loginWeb(false, void 0, params.runtime, accountId);
|
|
285
285
|
} catch (error) {
|
|
286
286
|
params.runtime.error(`WhatsApp login failed: ${String(error)}`);
|
package/dist/setup-plugin-api.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as whatsappSetupPlugin } from "./channel.setup-
|
|
1
|
+
import { t as whatsappSetupPlugin } from "./channel.setup-I-zFGu02.js";
|
|
2
2
|
export { whatsappSetupPlugin };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { t as listAccountIds } from "./account-ids-CB5SOWjc.js";
|
|
2
2
|
import { o as resolveWhatsAppAuthDir } from "./accounts-DgViSyJx.js";
|
|
3
|
-
import { a as formatWhatsAppWebAuthStatusState, h as readWebAuthState } from "./auth-store-
|
|
3
|
+
import { a as formatWhatsAppWebAuthStatusState, h as readWebAuthState } from "./auth-store-B2ZibndQ.js";
|
|
4
4
|
import { DEFAULT_ACCOUNT_ID, createSetupTranslator, setSetupChannelEnabled } from "openclaw/plugin-sdk/setup";
|
|
5
5
|
//#region extensions/whatsapp/src/setup-surface.ts
|
|
6
6
|
const t = createSetupTranslator();
|
|
@@ -36,7 +36,7 @@ const whatsappSetupWizard = {
|
|
|
36
36
|
},
|
|
37
37
|
resolveShouldPromptAccountIds: ({ shouldPromptAccountIds }) => shouldPromptAccountIds,
|
|
38
38
|
credentials: [],
|
|
39
|
-
finalize: async (params) => await (await import("./setup-finalize-
|
|
39
|
+
finalize: async (params) => await (await import("./setup-finalize-B-g0GzHp.js")).finalizeWhatsAppSetup(params),
|
|
40
40
|
disable: (cfg) => setSetupChannelEnabled(cfg, channel, false),
|
|
41
41
|
onAccountRecorded: (accountId, options) => {
|
|
42
42
|
options?.onAccountId?.(channel, accountId);
|
package/npm-shrinkwrap.json
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openclaw/whatsapp",
|
|
3
|
-
"version": "2026.6.
|
|
3
|
+
"version": "2026.6.5-beta.1",
|
|
4
4
|
"lockfileVersion": 3,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "@openclaw/whatsapp",
|
|
9
|
-
"version": "2026.6.
|
|
9
|
+
"version": "2026.6.5-beta.1",
|
|
10
10
|
"dependencies": {
|
|
11
11
|
"audio-decode": "2.2.3",
|
|
12
12
|
"baileys": "7.0.0-rc13",
|
|
13
13
|
"typebox": "1.1.39"
|
|
14
14
|
},
|
|
15
15
|
"peerDependencies": {
|
|
16
|
-
"openclaw": ">=2026.6.
|
|
16
|
+
"openclaw": ">=2026.6.5-beta.1"
|
|
17
17
|
},
|
|
18
18
|
"peerDependenciesMeta": {
|
|
19
19
|
"openclaw": {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openclaw/whatsapp",
|
|
3
|
-
"version": "2026.6.
|
|
3
|
+
"version": "2026.6.5-beta.1",
|
|
4
4
|
"description": "OpenClaw WhatsApp channel plugin for WhatsApp Web chats.",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
"typebox": "1.1.39"
|
|
14
14
|
},
|
|
15
15
|
"peerDependencies": {
|
|
16
|
-
"openclaw": ">=2026.6.
|
|
16
|
+
"openclaw": ">=2026.6.5-beta.1"
|
|
17
17
|
},
|
|
18
18
|
"peerDependenciesMeta": {
|
|
19
19
|
"openclaw": {
|
|
@@ -56,10 +56,10 @@
|
|
|
56
56
|
"minHostVersion": ">=2026.4.25"
|
|
57
57
|
},
|
|
58
58
|
"compat": {
|
|
59
|
-
"pluginApi": ">=2026.6.
|
|
59
|
+
"pluginApi": ">=2026.6.5-beta.1"
|
|
60
60
|
},
|
|
61
61
|
"build": {
|
|
62
|
-
"openclawVersion": "2026.6.
|
|
62
|
+
"openclawVersion": "2026.6.5-beta.1"
|
|
63
63
|
},
|
|
64
64
|
"release": {
|
|
65
65
|
"publishToClawHub": true,
|