@openclaw/whatsapp 2026.5.31-beta.3 → 2026.6.1-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 +4 -4
- package/dist/{channel-DigzkmDO.js → channel-BbtRTgNk.js} +1 -1
- package/dist/channel-plugin-api.js +1 -1
- package/dist/{channel.runtime-BzDa8nVv.js → channel.runtime-Cf2UgrhZ.js} +3 -3
- package/dist/{channel.setup-BRev7Qpj.js → channel.setup-DaIyWos-.js} +1 -1
- package/dist/{connection-controller-Bnm4INld.js → connection-controller-B07CNCkw.js} +1 -1
- package/dist/{login-2fuBM7Je.js → login-CRtqboZq.js} +2 -2
- package/dist/{login-qr-B1o7GFy8.js → login-qr-B27eAPhh.js} +8 -4
- package/dist/login-qr-runtime.js +1 -1
- package/dist/{monitor-D-vg4gJF.js → monitor-CnioHf5V.js} +25 -19
- package/dist/runtime-api.js +3 -3
- package/dist/{session-DyGWNClj.js → session-mBuvPUCy.js} +27 -18
- package/dist/{setup-core-D0ncRoh8.js → setup-core-C3XZ2KBH.js} +2 -2
- package/dist/{setup-finalize-BdztDwTy.js → setup-finalize-B7FVDzwJ.js} +2 -2
- package/dist/setup-plugin-api.js +1 -1
- package/dist/{setup-surface-DLueEnfx.js → setup-surface-CGTWO_-E.js} +1 -1
- 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-BbtRTgNk.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-C3XZ2KBH.js";
|
|
10
10
|
import "./config-schema-CROZuhT-.js";
|
|
11
|
-
import { t as whatsappSetupPlugin } from "./channel.setup-
|
|
11
|
+
import { t as whatsappSetupPlugin } from "./channel.setup-DaIyWos-.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-mBuvPUCy.js";
|
|
17
17
|
import "openclaw/plugin-sdk/channel-actions";
|
|
18
18
|
import "openclaw/plugin-sdk/account-resolution";
|
|
19
19
|
import "openclaw/plugin-sdk/core";
|
|
@@ -9,7 +9,7 @@ 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-
|
|
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-C3XZ2KBH.js";
|
|
13
13
|
import { f as readWebAuthExistsForDecision, n as WHATSAPP_AUTH_UNSTABLE_CODE } from "./auth-store-CZ22aNcV.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";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as whatsappPlugin } from "./channel-
|
|
1
|
+
import { t as whatsappPlugin } from "./channel-BbtRTgNk.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
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-CZ22aNcV.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-CnioHf5V.js";
|
|
5
|
+
import { t as loginWeb$1 } from "./login-CRtqboZq.js";
|
|
6
|
+
import { whatsappSetupWizard as whatsappSetupWizard$1 } from "./setup-surface-CGTWO_-E.js";
|
|
7
7
|
//#region extensions/whatsapp/src/channel.runtime.ts
|
|
8
8
|
function getActiveWebListener(...args) {
|
|
9
9
|
return getActiveWebListener$1(...args);
|
|
@@ -1,4 +1,4 @@
|
|
|
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-C3XZ2KBH.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) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { a as unregisterWhatsAppConnectionController, i as registerWhatsAppConnectionController, n as getStatusCode, t as formatError } from "./session-errors-CbsoQqoy.js";
|
|
2
2
|
import { c as logoutWeb } from "./auth-store-CZ22aNcV.js";
|
|
3
|
-
import { r as waitForWaConnection, t as createWaSocket } from "./session-
|
|
3
|
+
import { r as waitForWaConnection, t as createWaSocket } from "./session-mBuvPUCy.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
6
|
import { DisconnectReason } from "baileys";
|
|
@@ -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
3
|
import { b as restoreCredsFromBackupIfNeeded } from "./auth-store-CZ22aNcV.js";
|
|
4
|
-
import { a as renderQrTerminal, i as resolveWhatsAppSocketTiming, t as createWaSocket } from "./session-
|
|
5
|
-
import { a as closeWaSocketSoon, o as waitForWhatsAppLoginResult } from "./connection-controller-
|
|
4
|
+
import { a as renderQrTerminal, i as resolveWhatsAppSocketTiming, t as createWaSocket } from "./session-mBuvPUCy.js";
|
|
5
|
+
import { a as closeWaSocketSoon, o as waitForWhatsAppLoginResult } from "./connection-controller-B07CNCkw.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
2
|
import { f as readWebAuthExistsForDecision, g as readWebSelfId, n as WHATSAPP_AUTH_UNSTABLE_CODE } from "./auth-store-CZ22aNcV.js";
|
|
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-
|
|
3
|
+
import { i as resolveWhatsAppSocketTiming, t as createWaSocket } from "./session-mBuvPUCy.js";
|
|
4
|
+
import { i as closeWaSocket, o as waitForWhatsAppLoginResult, t as WHATSAPP_LOGGED_OUT_QR_MESSAGE } from "./connection-controller-B07CNCkw.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";
|
|
@@ -10,7 +10,9 @@ import { randomUUID } from "node:crypto";
|
|
|
10
10
|
import { getRuntimeConfig } from "openclaw/plugin-sdk/runtime-config-snapshot";
|
|
11
11
|
//#region extensions/whatsapp/src/login-qr.ts
|
|
12
12
|
function waitForNextTask() {
|
|
13
|
-
return new Promise((resolve) =>
|
|
13
|
+
return new Promise((resolve) => {
|
|
14
|
+
setImmediate(resolve);
|
|
15
|
+
});
|
|
14
16
|
}
|
|
15
17
|
const ACTIVE_LOGIN_TTL_MS = 3 * 6e4;
|
|
16
18
|
const MAX_QR_RENDER_CHASES = 10;
|
|
@@ -376,7 +378,9 @@ async function waitForWebLogin(opts = {}) {
|
|
|
376
378
|
connected: false,
|
|
377
379
|
message: "Still waiting for the QR scan. Let me know when you’ve scanned it."
|
|
378
380
|
};
|
|
379
|
-
const timeout = new Promise((resolve) =>
|
|
381
|
+
const timeout = new Promise((resolve) => {
|
|
382
|
+
setTimeout(() => resolve("timeout"), remaining);
|
|
383
|
+
});
|
|
380
384
|
const result = await Promise.race([
|
|
381
385
|
login.waitPromise.then(() => "done"),
|
|
382
386
|
login.qrUpdatePromise.then(() => "qr-update"),
|
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-B27eAPhh.js");
|
|
5
5
|
return loginQrModulePromise;
|
|
6
6
|
}
|
|
7
7
|
async function startWebLoginWithQr(...args) {
|
|
@@ -10,12 +10,12 @@ import { a as getSelfIdentity, c as resolveComparableIdentity, i as getReplyCont
|
|
|
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 { i as resolveWhatsAppSocketTiming, r as waitForWaConnection, t as createWaSocket } from "./session-
|
|
13
|
+
import { i as resolveWhatsAppSocketTiming, r as waitForWaConnection, t as createWaSocket } from "./session-mBuvPUCy.js";
|
|
14
14
|
import { t as BufferJSON } from "./session.runtime-LZFdq3yb.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-
|
|
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-B07CNCkw.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
|
-
import { createChannelMessageReplyPipeline,
|
|
18
|
+
import { createChannelMessageReplyPipeline, createDurableInboundReceiveJournalFromQueue, createMessageReceiptFromOutboundResults, deliverInboundReplyWithMessageSendContext, resolveChannelMessageSourceReplyDeliveryMode } from "openclaw/plugin-sdk/channel-outbound";
|
|
19
19
|
import { filterSupplementalContextItems, resolvePinnedMainDmOwnerFromAllowlist } from "openclaw/plugin-sdk/security-runtime";
|
|
20
20
|
import { DEFAULT_TIMING, createAckReactionHandle, createStatusReactionController, logAckFailure, removeAckReactionHandleAfterReply, shouldAckReactionForWhatsApp } from "openclaw/plugin-sdk/channel-feedback";
|
|
21
21
|
import { formatCliCommand } from "openclaw/plugin-sdk/cli-runtime";
|
|
@@ -159,21 +159,21 @@ function deserializeWhatsAppDurableInboundMessage(message) {
|
|
|
159
159
|
return JSON.parse(JSON.stringify(message), BufferJSON.reviver);
|
|
160
160
|
}
|
|
161
161
|
function createWhatsAppDurableInboundReceiveJournal(accountId) {
|
|
162
|
-
const runtime = getWhatsAppRuntime();
|
|
163
162
|
const accountPart = hashNamespacePart(accountId);
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
}),
|
|
170
|
-
completedStore: runtime.state.openKeyedStore({
|
|
171
|
-
namespace: `inbound.v1.completed.${accountPart}`,
|
|
172
|
-
maxEntries: WHATSAPP_DURABLE_INBOUND_COMPLETED_MAX_ENTRIES,
|
|
173
|
-
defaultTtlMs: WHATSAPP_DURABLE_INBOUND_COMPLETED_TTL_MS
|
|
163
|
+
const runtime = getWhatsAppRuntime();
|
|
164
|
+
return createDurableInboundReceiveJournalFromQueue({
|
|
165
|
+
queue: runtime.state.openChannelIngressQueue({
|
|
166
|
+
accountId: accountPart,
|
|
167
|
+
stateDir: runtime.state.resolveStateDir()
|
|
174
168
|
}),
|
|
175
|
-
|
|
176
|
-
|
|
169
|
+
retention: {
|
|
170
|
+
pendingTtlMs: WHATSAPP_DURABLE_INBOUND_PENDING_TTL_MS,
|
|
171
|
+
completedTtlMs: WHATSAPP_DURABLE_INBOUND_COMPLETED_TTL_MS,
|
|
172
|
+
failedTtlMs: WHATSAPP_DURABLE_INBOUND_PENDING_TTL_MS,
|
|
173
|
+
pendingMaxEntries: WHATSAPP_DURABLE_INBOUND_PENDING_MAX_ENTRIES,
|
|
174
|
+
completedMaxEntries: WHATSAPP_DURABLE_INBOUND_COMPLETED_MAX_ENTRIES,
|
|
175
|
+
failedMaxEntries: WHATSAPP_DURABLE_INBOUND_PENDING_MAX_ENTRIES
|
|
176
|
+
}
|
|
177
177
|
});
|
|
178
178
|
}
|
|
179
179
|
//#endregion
|
|
@@ -2384,7 +2384,9 @@ async function finalizeWhatsAppStatusReaction(params) {
|
|
|
2384
2384
|
if (params.outcome === "done") {
|
|
2385
2385
|
await params.controller.setDone();
|
|
2386
2386
|
if (params.removeAckAfterReply) {
|
|
2387
|
-
await new Promise((resolve) =>
|
|
2387
|
+
await new Promise((resolve) => {
|
|
2388
|
+
setTimeout(resolve, params.timing.doneHoldMs);
|
|
2389
|
+
});
|
|
2388
2390
|
await params.controller.clear();
|
|
2389
2391
|
} else await params.controller.restoreInitial();
|
|
2390
2392
|
return;
|
|
@@ -2392,12 +2394,16 @@ async function finalizeWhatsAppStatusReaction(params) {
|
|
|
2392
2394
|
await params.controller.setError();
|
|
2393
2395
|
if (params.hasFinalResponse) {
|
|
2394
2396
|
if (params.removeAckAfterReply) {
|
|
2395
|
-
await new Promise((resolve) =>
|
|
2397
|
+
await new Promise((resolve) => {
|
|
2398
|
+
setTimeout(resolve, params.timing.errorHoldMs);
|
|
2399
|
+
});
|
|
2396
2400
|
await params.controller.clear();
|
|
2397
2401
|
} else await params.controller.restoreInitial();
|
|
2398
2402
|
return;
|
|
2399
2403
|
}
|
|
2400
|
-
if (params.removeAckAfterReply) await new Promise((resolve) =>
|
|
2404
|
+
if (params.removeAckAfterReply) await new Promise((resolve) => {
|
|
2405
|
+
setTimeout(resolve, params.timing.errorHoldMs);
|
|
2406
|
+
});
|
|
2401
2407
|
await params.controller.restoreInitial();
|
|
2402
2408
|
}
|
|
2403
2409
|
//#endregion
|
package/dist/runtime-api.js
CHANGED
|
@@ -8,9 +8,9 @@ import { t as createWhatsAppLoginTool } from "./agent-tools-login-BX7eHgDm.js";
|
|
|
8
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-CZ22aNcV.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-mBuvPUCy.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-CnioHf5V.js";
|
|
14
|
+
import { t as loginWeb } from "./login-CRtqboZq.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 };
|
|
@@ -110,25 +110,27 @@ async function createWaSocket(printQr, verbose, opts = {}) {
|
|
|
110
110
|
fetchAgent
|
|
111
111
|
});
|
|
112
112
|
sock.ev.on("creds.update", () => enqueueSaveCreds(authDir, saveCreds, sessionLogger));
|
|
113
|
-
sock.ev.on("connection.update",
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
113
|
+
sock.ev.on("connection.update", (update) => {
|
|
114
|
+
(async () => {
|
|
115
|
+
try {
|
|
116
|
+
const { connection, lastDisconnect, qr } = update;
|
|
117
|
+
if (qr) {
|
|
118
|
+
opts.onQr?.(qr);
|
|
119
|
+
if (printQr) {
|
|
120
|
+
console.log("Open the WhatsApp app, go to Linked Devices, then scan this QR:");
|
|
121
|
+
printTerminalQr(qr).catch((err) => {
|
|
122
|
+
sessionLogger.warn({ error: String(err) }, "failed rendering WhatsApp QR");
|
|
123
|
+
});
|
|
124
|
+
}
|
|
123
125
|
}
|
|
126
|
+
if (connection === "close") {
|
|
127
|
+
if (getStatusCode(lastDisconnect?.error) === LOGGED_OUT_STATUS) console.error(danger(`WhatsApp session logged out. Run: ${formatCliCommand("openclaw channels login")}`));
|
|
128
|
+
}
|
|
129
|
+
if (connection === "open" && verbose) console.log(success("WhatsApp Web connected."));
|
|
130
|
+
} catch (err) {
|
|
131
|
+
sessionLogger.error({ error: String(err) }, "connection.update handler error");
|
|
124
132
|
}
|
|
125
|
-
|
|
126
|
-
if (getStatusCode(lastDisconnect?.error) === LOGGED_OUT_STATUS) console.error(danger(`WhatsApp session logged out. Run: ${formatCliCommand("openclaw channels login")}`));
|
|
127
|
-
}
|
|
128
|
-
if (connection === "open" && verbose) console.log(success("WhatsApp Web connected."));
|
|
129
|
-
} catch (err) {
|
|
130
|
-
sessionLogger.error({ error: String(err) }, "connection.update handler error");
|
|
131
|
-
}
|
|
133
|
+
})();
|
|
132
134
|
});
|
|
133
135
|
if (sock.ws && typeof sock.ws.on === "function") sock.ws.on("error", (err) => {
|
|
134
136
|
sessionLogger.error({ error: String(err) }, "WebSocket error");
|
|
@@ -194,7 +196,7 @@ async function waitForWaConnection(sock) {
|
|
|
194
196
|
}
|
|
195
197
|
if (update.connection === "close") {
|
|
196
198
|
evWithOff.off?.("connection.update", handler);
|
|
197
|
-
reject(update.lastDisconnect ?? /* @__PURE__ */ new Error("Connection closed"));
|
|
199
|
+
reject(toLintErrorObject(update.lastDisconnect ?? /* @__PURE__ */ new Error("Connection closed"), "Non-Error rejection"));
|
|
198
200
|
}
|
|
199
201
|
};
|
|
200
202
|
sock.ev.on("connection.update", handler);
|
|
@@ -203,5 +205,12 @@ async function waitForWaConnection(sock) {
|
|
|
203
205
|
function newConnectionId() {
|
|
204
206
|
return randomUUID();
|
|
205
207
|
}
|
|
208
|
+
function toLintErrorObject(value, fallbackMessage) {
|
|
209
|
+
if (value instanceof Error) return value;
|
|
210
|
+
if (typeof value === "string") return new Error(value);
|
|
211
|
+
const error = new Error(fallbackMessage, { cause: value });
|
|
212
|
+
if (typeof value === "object" && value !== null || typeof value === "function") Object.assign(error, value);
|
|
213
|
+
return error;
|
|
214
|
+
}
|
|
206
215
|
//#endregion
|
|
207
216
|
export { renderQrTerminal as a, resolveWhatsAppSocketTiming as i, newConnectionId as n, waitForWaConnection as r, createWaSocket 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-Cf2UgrhZ.js");
|
|
103
103
|
}
|
|
104
104
|
async function loadWhatsAppSetupSurface() {
|
|
105
|
-
return await import("./setup-surface-
|
|
105
|
+
return await import("./setup-surface-CGTWO_-E.js");
|
|
106
106
|
}
|
|
107
107
|
const whatsappSetupWizardProxy = createWhatsAppSetupWizardProxy(async () => (await loadWhatsAppSetupSurface()).whatsappSetupWizard);
|
|
108
108
|
const whatsappConfigAdapter = createScopedChannelConfigAdapter({
|
|
@@ -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-C3XZ2KBH.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-CRtqboZq.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-DaIyWos-.js";
|
|
2
2
|
export { whatsappSetupPlugin };
|
|
@@ -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-B7FVDzwJ.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.
|
|
3
|
+
"version": "2026.6.1-beta.1",
|
|
4
4
|
"lockfileVersion": 3,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "@openclaw/whatsapp",
|
|
9
|
-
"version": "2026.
|
|
9
|
+
"version": "2026.6.1-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.
|
|
16
|
+
"openclaw": ">=2026.6.1-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.
|
|
3
|
+
"version": "2026.6.1-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.
|
|
16
|
+
"openclaw": ">=2026.6.1-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.
|
|
59
|
+
"pluginApi": ">=2026.6.1-beta.1"
|
|
60
60
|
},
|
|
61
61
|
"build": {
|
|
62
|
-
"openclawVersion": "2026.
|
|
62
|
+
"openclawVersion": "2026.6.1-beta.1"
|
|
63
63
|
},
|
|
64
64
|
"release": {
|
|
65
65
|
"publishToClawHub": true,
|