@openclaw/whatsapp 2026.5.19 → 2026.5.20-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{access-control-Blo69-dW.js → access-control-p_vcYDW7.js} +4 -4
- package/dist/{accounts-CJNZl-3e.js → accounts-BPYgj8Fv.js} +4 -8
- package/dist/{action-runtime-cZLWNUXF.js → action-runtime-D4UqEXqf.js} +4 -4
- package/dist/action-runtime-api.js +1 -1
- package/dist/action-runtime.runtime.js +1 -1
- package/dist/{active-listener-C4ClVut4.js → active-listener-B4SDebQ6.js} +2 -2
- package/dist/{agent-tools-login-DpRxLNRB.js → agent-tools-login-BDzvb3ee.js} +0 -1
- package/dist/api.js +18 -18
- package/dist/auth-presence.js +1 -1
- package/dist/{auth-store-BLGYDyCH.js → auth-store-GTQvJznL.js} +55 -64
- package/dist/{channel-CHsR8MoG.js → channel-BVMD1oZL.js} +17 -17
- package/dist/channel-config-api.js +1 -1
- package/dist/channel-plugin-api.js +1 -1
- package/dist/{channel-react-action-6n63NhGY.js → channel-react-action-CHdR3gbn.js} +5 -5
- package/dist/{channel.runtime-n14SNsjm.js → channel.runtime-BBPZSziE.js} +5 -5
- package/dist/{channel.setup-BiuhxbjG.js → channel.setup-BDH3Mk5M.js} +3 -3
- package/dist/{connection-controller-Cq6sY2mA.js → connection-controller-9TXWZRhx.js} +4 -4
- package/dist/constants.js +1 -1
- package/dist/contract-api.js +8 -8
- package/dist/creds-files-B1kSWtBg.js +79 -0
- package/dist/{directory-config-QH8Oe8bc.js → directory-config-CfLFAK54.js} +4 -4
- package/dist/directory-contract-api.js +1 -1
- package/dist/doctor-contract-api.js +1 -1
- package/dist/{identity-CVFJuB0Q.js → identity-xoLLdqEv.js} +1 -1
- package/dist/legacy-session-surface-api.js +1 -1
- package/dist/legacy-state-migrations-api.js +1 -1
- package/dist/light-runtime-api.js +4 -4
- package/dist/{login-DJYp3l4Z.js → login-nJwaNuC-.js} +5 -5
- package/dist/{login-qr-CipY7q23.js → login-qr-l4UaR8Dj.js} +4 -4
- package/dist/login-qr-runtime.js +1 -1
- package/dist/{monitor-oXSnOpto.js → monitor-Dw2i5QSQ.js} +20 -26
- package/dist/normalize-Bxwqo-bW.js +2 -0
- package/dist/{outbound-adapter-BT7Dkqni.js → outbound-adapter-ltiZkW9L.js} +4 -4
- package/dist/{outbound-base-ARCS45ql.js → outbound-base-E84SMkd9.js} +3 -3
- package/dist/{outbound-media-contract-ItL7G0Az.js → outbound-media-contract-ioTkt8tn.js} +3 -3
- package/dist/outbound-payload-test-api.js +1 -1
- package/dist/{quoted-message-C5vX90mp.js → quoted-message-CveINB35.js} +1 -1
- package/dist/{reaction-level-DeO7ktWb.js → reaction-level-BqMOEBeq.js} +1 -1
- package/dist/{resolve-outbound-target-Ba7sH80H.js → resolve-outbound-target-CV-iBmSG.js} +1 -1
- package/dist/runtime-api.js +13 -13
- package/dist/security-contract-api.js +1 -1
- package/dist/{send-BtGELs96.js → send-E_kMiuZP.js} +8 -8
- package/dist/{send-api-BvUGZEIA.js → send-api-CXPUXbUL.js} +6 -6
- package/dist/{session-DqDc1usL.js → session-CPsgRMMa.js} +18 -10
- package/dist/{session.runtime-BxyATGX0.js → session.runtime-C6uBkEaI.js} +1 -1
- package/dist/{setup-core-P6dnz4Ur.js → setup-core-Dm1hsI3r.js} +10 -10
- package/dist/{setup-finalize-DYm-2hSc.js → setup-finalize-BlTQrUj9.js} +8 -8
- package/dist/setup-plugin-api.js +1 -1
- package/dist/{setup-surface-Bq3gnUCD.js → setup-surface-DqY0LqAY.js} +4 -4
- package/dist/targets.js +1 -1
- package/dist/test-api.js +2 -2
- package/package.json +5 -5
- package/dist/creds-files-_2V8jzQa.js +0 -19
- package/dist/normalize-LMXvL6w0.js +0 -2
- /package/dist/{account-config-D3OXPtpW.js → account-config-Bxl16soz.js} +0 -0
- /package/dist/{account-ids-DgtV_RiP.js → account-ids-CB5SOWjc.js} +0 -0
- /package/dist/{audio-preflight.runtime-CIFjeaEN.js → audio-preflight.runtime-C_glQhZY.js} +0 -0
- /package/dist/{command-policy-O8sRnqUV.js → command-policy-BIOSHySD.js} +0 -0
- /package/dist/{config-schema-Dmo66Ubb.js → config-schema-CsNDlDpL.js} +0 -0
- /package/dist/{connection-controller-registry-D_iIGz5m.js → connection-controller-registry-TSX_udJp.js} +0 -0
- /package/dist/{constants-yKXGCGU9.js → constants-HU41RHGI.js} +0 -0
- /package/dist/{doctor-A9tXm9Om.js → doctor-By3SB4lm.js} +0 -0
- /package/dist/{group-session-contract-DdqigLJl.js → group-session-contract-DDnZSsJ1.js} +0 -0
- /package/dist/{normalize-target-MB6Z_4Bn.js → normalize-target-bVWjgftN.js} +0 -0
- /package/dist/{reply-resolver.runtime-CROyXXQh.js → reply-resolver.runtime-Ded8D58Y.js} +0 -0
- /package/dist/{rolldown-runtime-CiIaOW0V.js → rolldown-runtime-D7D4PA-g.js} +0 -0
- /package/dist/{runtime-6fZ67abR.js → runtime-CboC4QhQ.js} +0 -0
- /package/dist/{runtime-group-policy-BH_U23qp.js → runtime-group-policy-DeSRFXEV.js} +0 -0
- /package/dist/{security-contract-CvfWex9e.js → security-contract-nAzD945y.js} +0 -0
- /package/dist/{session-contract-B0efQf9P.js → session-contract-DMTm6Q_L.js} +0 -0
- /package/dist/{session-errors-KYQIoX8M.js → session-errors-BAj9D2La.js} +0 -0
- /package/dist/{state-migrations-CtdIArlK.js → state-migrations-D_BmQUR9.js} +0 -0
- /package/dist/{text-runtime-DyR0XOJ4.js → text-runtime-Dk37KYHj.js} +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as normalizeCompatibilityConfig$1 } from "./doctor-
|
|
1
|
+
import { t as normalizeCompatibilityConfig$1 } from "./doctor-By3SB4lm.js";
|
|
2
2
|
//#region extensions/whatsapp/src/doctor-contract.ts
|
|
3
3
|
function normalizeCompatibilityConfig({ cfg }) {
|
|
4
4
|
return normalizeCompatibilityConfig$1({ cfg });
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as normalizeE164, u as jidToE164 } from "./text-runtime-
|
|
1
|
+
import { n as normalizeE164, u as jidToE164 } from "./text-runtime-Dk37KYHj.js";
|
|
2
2
|
//#region extensions/whatsapp/src/identity.ts
|
|
3
3
|
const WHATSAPP_LID_RE = /@(lid|hosted\.lid)$/i;
|
|
4
4
|
function normalizeDeviceScopedJid(jid) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { r as isLegacyGroupSessionKey, t as canonicalizeLegacySessionKey } from "./session-contract-
|
|
1
|
+
import { r as isLegacyGroupSessionKey, t as canonicalizeLegacySessionKey } from "./session-contract-DMTm6Q_L.js";
|
|
2
2
|
//#region extensions/whatsapp/legacy-session-surface-api.ts
|
|
3
3
|
const whatsappLegacySessionSurface = {
|
|
4
4
|
isLegacyGroupSessionKey,
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as detectWhatsAppLegacyStateMigrations } from "./state-migrations-
|
|
1
|
+
import { t as detectWhatsAppLegacyStateMigrations } from "./state-migrations-D_BmQUR9.js";
|
|
2
2
|
export { detectWhatsAppLegacyStateMigrations };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { n as getStatusCode, t as formatError } from "./session-errors-
|
|
2
|
-
import { t as createWhatsAppLoginTool } from "./agent-tools-login-
|
|
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 } from "./auth-store-
|
|
4
|
-
import { t as getActiveWebListener } from "./active-listener-
|
|
1
|
+
import { n as getStatusCode, t as formatError } from "./session-errors-BAj9D2La.js";
|
|
2
|
+
import { t as createWhatsAppLoginTool } from "./agent-tools-login-BDzvb3ee.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 } from "./auth-store-GTQvJznL.js";
|
|
4
|
+
import { t as getActiveWebListener } from "./active-listener-B4SDebQ6.js";
|
|
5
5
|
export { WA_WEB_AUTH_DIR, createWhatsAppLoginTool, formatError, getActiveWebListener, getStatusCode, getWebAuthAgeMs, logWebSelfId, logoutWeb, pickWebChannel, readWebSelfId, webAuthExists };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { t as __exportAll } from "./rolldown-runtime-
|
|
2
|
-
import { a as resolveWhatsAppAccount } from "./accounts-
|
|
3
|
-
import { b 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-
|
|
1
|
+
import { t as __exportAll } from "./rolldown-runtime-D7D4PA-g.js";
|
|
2
|
+
import { a as resolveWhatsAppAccount } from "./accounts-BPYgj8Fv.js";
|
|
3
|
+
import { b as restoreCredsFromBackupIfNeeded } from "./auth-store-GTQvJznL.js";
|
|
4
|
+
import { a as renderQrTerminal, i as resolveWhatsAppSocketTiming, t as createWaSocket } from "./session-CPsgRMMa.js";
|
|
5
|
+
import { a as closeWaSocketSoon, o as waitForWhatsAppLoginResult } from "./connection-controller-9TXWZRhx.js";
|
|
6
6
|
import { formatCliCommand } from "openclaw/plugin-sdk/cli-runtime";
|
|
7
7
|
import { logInfo } from "openclaw/plugin-sdk/logging-core";
|
|
8
8
|
import { danger, defaultRuntime, success } from "openclaw/plugin-sdk/runtime-env";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { a as resolveWhatsAppAccount } from "./accounts-
|
|
2
|
-
import { f as readWebAuthExistsForDecision, g as readWebSelfId, n as WHATSAPP_AUTH_UNSTABLE_CODE } from "./auth-store-
|
|
3
|
-
import { i as resolveWhatsAppSocketTiming, t as createWaSocket } from "./session-
|
|
4
|
-
import { i as closeWaSocket, o as waitForWhatsAppLoginResult, t as WHATSAPP_LOGGED_OUT_QR_MESSAGE } from "./connection-controller-
|
|
1
|
+
import { a as resolveWhatsAppAccount } from "./accounts-BPYgj8Fv.js";
|
|
2
|
+
import { f as readWebAuthExistsForDecision, g as readWebSelfId, n as WHATSAPP_AUTH_UNSTABLE_CODE } from "./auth-store-GTQvJznL.js";
|
|
3
|
+
import { i as resolveWhatsAppSocketTiming, t as createWaSocket } from "./session-CPsgRMMa.js";
|
|
4
|
+
import { i as closeWaSocket, o as waitForWhatsAppLoginResult, t as WHATSAPP_LOGGED_OUT_QR_MESSAGE } from "./connection-controller-9TXWZRhx.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-l4UaR8Dj.js");
|
|
5
5
|
return loginQrModulePromise;
|
|
6
6
|
}
|
|
7
7
|
async function startWebLoginWithQr(...args) {
|
|
@@ -1,26 +1,26 @@
|
|
|
1
|
-
import { a as resolveWhatsAppAccount, s as resolveWhatsAppMediaMaxBytes } from "./accounts-
|
|
2
|
-
import { t as isWhatsAppGroupJid } from "./normalize-target-
|
|
3
|
-
import { t as resolveWhatsAppReactionLevel } from "./reaction-level-
|
|
4
|
-
import { i as prepareWhatsAppOutboundMedia, o as sendWhatsAppOutboundWithRetry, r as normalizeWhatsAppPayloadTextPreservingIndentation, t as normalizeWhatsAppOutboundPayload } from "./outbound-media-contract-
|
|
5
|
-
import { n as getStatusCode, t as formatError } from "./session-errors-
|
|
6
|
-
import { d as markdownToWhatsApp, f as resolveJidToE164, l as isSelfChatMode, n as normalizeE164, t as convertMarkdownTables$1, u as jidToE164 } from "./text-runtime-
|
|
7
|
-
import { r as sendReactionWhatsApp } from "./send-
|
|
8
|
-
import { n as cacheInboundMessageMeta, r as lookupInboundMessageMeta, t as buildQuotedMessageOptions } from "./quoted-message-
|
|
9
|
-
import { c as logoutWeb, g as readWebSelfId, o as getWebAuthAgeMs, r as WhatsAppAuthUnstableError, v as readWebSelfIdentityForDecision } from "./auth-store-
|
|
10
|
-
import { a as getSelfIdentity, c as resolveComparableIdentity, i as getReplyContext, n as getMentionIdentities, o as getSenderIdentity, r as getPrimaryIdentityId, s as identitiesOverlap, t as getComparableIdentityValues } from "./identity-
|
|
11
|
-
import { i as resolveWhatsAppInboundPolicy, r as resolveWhatsAppCommandAuthorized, t as checkInboundAccessControl } 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-
|
|
1
|
+
import { a as resolveWhatsAppAccount, s as resolveWhatsAppMediaMaxBytes } from "./accounts-BPYgj8Fv.js";
|
|
2
|
+
import { t as isWhatsAppGroupJid } from "./normalize-target-bVWjgftN.js";
|
|
3
|
+
import { t as resolveWhatsAppReactionLevel } from "./reaction-level-BqMOEBeq.js";
|
|
4
|
+
import { i as prepareWhatsAppOutboundMedia, o as sendWhatsAppOutboundWithRetry, r as normalizeWhatsAppPayloadTextPreservingIndentation, t as normalizeWhatsAppOutboundPayload } from "./outbound-media-contract-ioTkt8tn.js";
|
|
5
|
+
import { n as getStatusCode, t as formatError } from "./session-errors-BAj9D2La.js";
|
|
6
|
+
import { d as markdownToWhatsApp, f as resolveJidToE164, l as isSelfChatMode, n as normalizeE164, t as convertMarkdownTables$1, u as jidToE164 } from "./text-runtime-Dk37KYHj.js";
|
|
7
|
+
import { r as sendReactionWhatsApp } from "./send-E_kMiuZP.js";
|
|
8
|
+
import { n as cacheInboundMessageMeta, r as lookupInboundMessageMeta, t as buildQuotedMessageOptions } from "./quoted-message-CveINB35.js";
|
|
9
|
+
import { c as logoutWeb, g as readWebSelfId, o as getWebAuthAgeMs, r as WhatsAppAuthUnstableError, v as readWebSelfIdentityForDecision } from "./auth-store-GTQvJznL.js";
|
|
10
|
+
import { a as getSelfIdentity, c as resolveComparableIdentity, i as getReplyContext, n as getMentionIdentities, o as getSenderIdentity, r as getPrimaryIdentityId, s as identitiesOverlap, t as getComparableIdentityValues } from "./identity-xoLLdqEv.js";
|
|
11
|
+
import { i as resolveWhatsAppInboundPolicy, r as resolveWhatsAppCommandAuthorized, t as checkInboundAccessControl } from "./access-control-p_vcYDW7.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-CXPUXbUL.js";
|
|
13
|
+
import { i as resolveWhatsAppSocketTiming, r as waitForWaConnection, t as createWaSocket } from "./session-CPsgRMMa.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-9TXWZRhx.js";
|
|
15
15
|
import { resolveAccountEntry } from "openclaw/plugin-sdk/account-core";
|
|
16
16
|
import { normalizeLowercaseStringOrEmpty } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
17
|
+
import { evaluateSupplementalContextVisibility, filterSupplementalContextItems, resolvePinnedMainDmOwnerFromAllowlist } from "openclaw/plugin-sdk/security-runtime";
|
|
17
18
|
import { DEFAULT_TIMING, createAckReactionHandle, createStatusReactionController, logAckFailure, removeAckReactionHandleAfterReply, shouldAckReactionForWhatsApp } from "openclaw/plugin-sdk/channel-feedback";
|
|
18
19
|
import { formatCliCommand } from "openclaw/plugin-sdk/cli-runtime";
|
|
19
20
|
import { getChildLogger } from "openclaw/plugin-sdk/logging-core";
|
|
20
21
|
import { resolveMarkdownTableMode as resolveMarkdownTableMode$1 } from "openclaw/plugin-sdk/markdown-table-runtime";
|
|
21
22
|
import { createSubsystemLogger, defaultRuntime, formatDurationPrecise, getChildLogger as getChildLogger$1, logVerbose, logVerbose as logVerbose$1, registerUnhandledRejectionHandler, shouldLogVerbose, shouldLogVerbose as shouldLogVerbose$1, warn } from "openclaw/plugin-sdk/runtime-env";
|
|
22
23
|
import { getAgentScopedMediaLocalRoots } from "openclaw/plugin-sdk/media-runtime";
|
|
23
|
-
import { evaluateSupplementalContextVisibility, filterSupplementalContextItems, resolvePinnedMainDmOwnerFromAllowlist } from "openclaw/plugin-sdk/security-runtime";
|
|
24
24
|
import { LocalMediaAccessError, getDefaultLocalRoots, loadWebMedia as loadWebMedia$1, loadWebMediaRaw, optimizeImageToJpeg, optimizeImageToPng } from "openclaw/plugin-sdk/web-media";
|
|
25
25
|
import { createChannelMessageReplyPipeline, createMessageReceiptFromOutboundResults, deliverInboundReplyWithMessageSendContext, resolveChannelMessageSourceReplyDeliveryMode } from "openclaw/plugin-sdk/channel-message";
|
|
26
26
|
import { chunkMarkdownTextWithMode } from "openclaw/plugin-sdk/reply-chunking";
|
|
@@ -2250,7 +2250,7 @@ async function processMessage(params) {
|
|
|
2250
2250
|
let audioTranscript = params.preflightAudioTranscript ?? void 0;
|
|
2251
2251
|
const hasAudioBody = params.msg.mediaType?.startsWith("audio/") === true && params.msg.body === "<media:audio>";
|
|
2252
2252
|
if (params.preflightAudioTranscript === void 0 && hasAudioBody && params.msg.mediaPath) try {
|
|
2253
|
-
const { transcribeFirstAudio } = await import("./audio-preflight.runtime-
|
|
2253
|
+
const { transcribeFirstAudio } = await import("./audio-preflight.runtime-C_glQhZY.js");
|
|
2254
2254
|
audioTranscript = await transcribeFirstAudio({
|
|
2255
2255
|
ctx: {
|
|
2256
2256
|
MediaPaths: [params.msg.mediaPath],
|
|
@@ -2617,7 +2617,7 @@ function createWebOnMessageHandler(params) {
|
|
|
2617
2617
|
ackAlreadySent = ackReaction !== null;
|
|
2618
2618
|
}
|
|
2619
2619
|
try {
|
|
2620
|
-
const { transcribeFirstAudio } = await import("./audio-preflight.runtime-
|
|
2620
|
+
const { transcribeFirstAudio } = await import("./audio-preflight.runtime-C_glQhZY.js");
|
|
2621
2621
|
preflightAudioTranscript = await transcribeFirstAudio({
|
|
2622
2622
|
ctx: {
|
|
2623
2623
|
MediaPaths: [msg.mediaPath],
|
|
@@ -2742,7 +2742,7 @@ function isNonRetryableWebCloseStatus(statusCode) {
|
|
|
2742
2742
|
}
|
|
2743
2743
|
let replyResolverRuntimePromise = null;
|
|
2744
2744
|
function loadReplyResolverRuntime() {
|
|
2745
|
-
replyResolverRuntimePromise ??= import("./reply-resolver.runtime-
|
|
2745
|
+
replyResolverRuntimePromise ??= import("./reply-resolver.runtime-Ded8D58Y.js");
|
|
2746
2746
|
return replyResolverRuntimePromise;
|
|
2747
2747
|
}
|
|
2748
2748
|
function resolveWebMonitorConfigSnapshot(params) {
|
|
@@ -3074,10 +3074,7 @@ async function monitorWebChannel(verbose, listenerFactory = attachWebInboxToSock
|
|
|
3074
3074
|
channel: "whatsapp",
|
|
3075
3075
|
accountId: account.accountId
|
|
3076
3076
|
});
|
|
3077
|
-
enqueueSystemEvent(`WhatsApp gateway connected${selfE164 ? ` as ${selfE164}` : ""}.`, {
|
|
3078
|
-
sessionKey: connectRoute.sessionKey,
|
|
3079
|
-
trusted: true
|
|
3080
|
-
});
|
|
3077
|
+
enqueueSystemEvent(`WhatsApp gateway connected${selfE164 ? ` as ${selfE164}` : ""}.`, { sessionKey: connectRoute.sessionKey });
|
|
3081
3078
|
const normalizedAccountId = normalizeReconnectAccountId(account.accountId);
|
|
3082
3079
|
drainPendingDeliveries({
|
|
3083
3080
|
drainKey: `whatsapp:${normalizedAccountId}`,
|
|
@@ -3145,10 +3142,7 @@ async function monitorWebChannel(verbose, listenerFactory = attachWebInboxToSock
|
|
|
3145
3142
|
reconnectAttempts: decision.reconnectAttempts,
|
|
3146
3143
|
error: decision.normalized.errorText
|
|
3147
3144
|
}, "web reconnect: connection closed");
|
|
3148
|
-
enqueueSystemEvent(`WhatsApp gateway disconnected (status ${decision.normalized.statusLabel})`, {
|
|
3149
|
-
sessionKey: connectRoute.sessionKey,
|
|
3150
|
-
trusted: true
|
|
3151
|
-
});
|
|
3145
|
+
enqueueSystemEvent(`WhatsApp gateway disconnected (status ${decision.normalized.statusLabel})`, { sessionKey: connectRoute.sessionKey });
|
|
3152
3146
|
if (decision.action === "stop") {
|
|
3153
3147
|
await controller.closeCurrentConnection();
|
|
3154
3148
|
statusController.noteClose({
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { t as resolveWhatsAppOutboundTarget } from "./resolve-outbound-target-
|
|
2
|
-
import { n as normalizeWhatsAppPayloadText } from "./outbound-media-contract-
|
|
3
|
-
import { t as createWhatsAppOutboundBase } from "./outbound-base-
|
|
1
|
+
import { t as resolveWhatsAppOutboundTarget } from "./resolve-outbound-target-CV-iBmSG.js";
|
|
2
|
+
import { n as normalizeWhatsAppPayloadText } from "./outbound-media-contract-ioTkt8tn.js";
|
|
3
|
+
import { t as createWhatsAppOutboundBase } from "./outbound-base-E84SMkd9.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-E_kMiuZP.js").then((n) => n.a);
|
|
10
10
|
return whatsAppSendModulePromise;
|
|
11
11
|
}
|
|
12
12
|
function normalizeOutboundText(text) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { n as normalizeWhatsAppPayloadText, t as normalizeWhatsAppOutboundPayload } from "./outbound-media-contract-
|
|
2
|
-
import { p as toWhatsappJid } from "./text-runtime-
|
|
3
|
-
import { i as lookupInboundMessageMetaForTarget } from "./quoted-message-
|
|
1
|
+
import { n as normalizeWhatsAppPayloadText, t as normalizeWhatsAppOutboundPayload } from "./outbound-media-contract-ioTkt8tn.js";
|
|
2
|
+
import { p as toWhatsappJid } from "./text-runtime-Dk37KYHj.js";
|
|
3
|
+
import { i as lookupInboundMessageMetaForTarget } from "./quoted-message-CveINB35.js";
|
|
4
4
|
import { DEFAULT_ACCOUNT_ID, listCombinedAccountIds, normalizeOptionalAccountId, resolveListedDefaultAccountId } from "openclaw/plugin-sdk/account-core";
|
|
5
5
|
import { createAttachedChannelResultAdapter } from "openclaw/plugin-sdk/channel-send-result";
|
|
6
6
|
import { resolveOutboundSendDep } from "openclaw/plugin-sdk/outbound-send-deps";
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { t as formatError } from "./session-errors-
|
|
2
|
-
import { a as sanitizeAssistantVisibleTextWithProfile, i as sanitizeAssistantVisibleText, o as sleep, s as stripToolCallXmlTags } from "./text-runtime-
|
|
1
|
+
import { t as formatError } from "./session-errors-BAj9D2La.js";
|
|
2
|
+
import { a as sanitizeAssistantVisibleTextWithProfile, i as sanitizeAssistantVisibleText, o as sleep, s as stripToolCallXmlTags } from "./text-runtime-Dk37KYHj.js";
|
|
3
3
|
import path from "node:path";
|
|
4
|
+
import { writeExternalFileWithinRoot } from "openclaw/plugin-sdk/security-runtime";
|
|
4
5
|
import { extensionForMime } from "openclaw/plugin-sdk/media-mime";
|
|
5
6
|
import { MEDIA_FFMPEG_MAX_AUDIO_DURATION_SECS, runFfmpeg } from "openclaw/plugin-sdk/media-runtime";
|
|
6
7
|
import { sanitizeForPlainText } from "openclaw/plugin-sdk/outbound-runtime";
|
|
7
|
-
import { writeExternalFileWithinRoot } from "openclaw/plugin-sdk/security-runtime";
|
|
8
8
|
import { resolvePreferredOpenClawTmpDir, withTempWorkspace } from "openclaw/plugin-sdk/temp-path";
|
|
9
9
|
//#region extensions/whatsapp/src/document-filename.ts
|
|
10
10
|
const WHATSAPP_DEFAULT_DOCUMENT_FILE_NAME = "file";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as whatsappOutbound } from "./outbound-adapter-
|
|
1
|
+
import { t as whatsappOutbound } from "./outbound-adapter-ltiZkW9L.js";
|
|
2
2
|
export { whatsappOutbound };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as resolveMergedWhatsAppAccountConfig } from "./account-config-
|
|
1
|
+
import { t as resolveMergedWhatsAppAccountConfig } from "./account-config-Bxl16soz.js";
|
|
2
2
|
import { resolveReactionLevel } from "openclaw/plugin-sdk/status-helpers";
|
|
3
3
|
//#region extensions/whatsapp/src/reaction-level.ts
|
|
4
4
|
/** Resolve the effective reaction level and its implications for WhatsApp. */
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { c as normalizeWhatsAppTarget, n as isWhatsAppNewsletterJid, t as isWhatsAppGroupJid } from "./normalize-target-
|
|
1
|
+
import { c as normalizeWhatsAppTarget, n as isWhatsAppNewsletterJid, t as isWhatsAppGroupJid } from "./normalize-target-bVWjgftN.js";
|
|
2
2
|
import { missingTargetError } from "openclaw/plugin-sdk/channel-feedback";
|
|
3
3
|
//#region extensions/whatsapp/src/resolve-outbound-target.ts
|
|
4
4
|
function whatsappAllowFromPolicyError(target) {
|
package/dist/runtime-api.js
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { n as whatsAppActionRuntime, t as handleWhatsAppAction } from "./action-runtime-
|
|
3
|
-
import { n as getStatusCode, t as formatError } from "./session-errors-
|
|
4
|
-
import { i as sendTypingWhatsApp, n as sendPollWhatsApp, r as sendReactionWhatsApp, t as sendMessageWhatsApp } from "./send-
|
|
1
|
+
import { o as resolveWebCredsBackupPath, r as hasWebCredsSync, s as resolveWebCredsPath } from "./creds-files-B1kSWtBg.js";
|
|
2
|
+
import { n as whatsAppActionRuntime, t as handleWhatsAppAction } from "./action-runtime-D4UqEXqf.js";
|
|
3
|
+
import { n as getStatusCode, t as formatError } from "./session-errors-BAj9D2La.js";
|
|
4
|
+
import { i as sendTypingWhatsApp, n as sendPollWhatsApp, r as sendReactionWhatsApp, t as sendMessageWhatsApp } from "./send-E_kMiuZP.js";
|
|
5
5
|
import { startWebLoginWithQr, waitForWebLogin } from "./login-qr-runtime.js";
|
|
6
|
-
import { t as createWhatsAppLoginTool } from "./agent-tools-login-
|
|
7
|
-
import { n as setWhatsAppRuntime } from "./runtime-
|
|
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-
|
|
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-
|
|
6
|
+
import { t as createWhatsAppLoginTool } from "./agent-tools-login-BDzvb3ee.js";
|
|
7
|
+
import { n as setWhatsAppRuntime } from "./runtime-CboC4QhQ.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-GTQvJznL.js";
|
|
9
|
+
import { t as DEFAULT_WEB_MEDIA_BYTES } from "./constants-HU41RHGI.js";
|
|
10
|
+
import { c as extractContactContext, d as extractMediaPlaceholder, p as extractText, u as extractLocationData } from "./send-api-CXPUXbUL.js";
|
|
11
|
+
import { n as newConnectionId, r as waitForWaConnection, t as createWaSocket } from "./session-CPsgRMMa.js";
|
|
12
|
+
import { n as resolveWebAccountId, t as getActiveWebListener } from "./active-listener-B4SDebQ6.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-Dw2i5QSQ.js";
|
|
14
|
+
import { t as loginWeb } from "./login-nJwaNuC-.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,2 +1,2 @@
|
|
|
1
|
-
import { n as unsupportedSecretRefSurfacePatterns, t as collectUnsupportedSecretRefConfigCandidates } from "./security-contract-
|
|
1
|
+
import { n as unsupportedSecretRefSurfacePatterns, t as collectUnsupportedSecretRefConfigCandidates } from "./security-contract-nAzD945y.js";
|
|
2
2
|
export { collectUnsupportedSecretRefConfigCandidates, unsupportedSecretRefSurfacePatterns };
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { t as __exportAll } from "./rolldown-runtime-
|
|
2
|
-
import { r as resolveDefaultWhatsAppAccountId } from "./account-ids-
|
|
3
|
-
import { a as resolveWhatsAppAccount, s as resolveWhatsAppMediaMaxBytes } from "./accounts-
|
|
4
|
-
import { n as isWhatsAppNewsletterJid } from "./normalize-target-
|
|
5
|
-
import { t as getRegisteredWhatsAppConnectionController } from "./connection-controller-registry-
|
|
6
|
-
import { a as resolveWhatsAppOutboundMediaUrls, i as prepareWhatsAppOutboundMedia, n as normalizeWhatsAppPayloadText, s as resolveWhatsAppDocumentFileName } from "./outbound-media-contract-
|
|
7
|
-
import "./normalize-
|
|
8
|
-
import { d as markdownToWhatsApp, p as toWhatsappJid } from "./text-runtime-
|
|
1
|
+
import { t as __exportAll } from "./rolldown-runtime-D7D4PA-g.js";
|
|
2
|
+
import { r as resolveDefaultWhatsAppAccountId } from "./account-ids-CB5SOWjc.js";
|
|
3
|
+
import { a as resolveWhatsAppAccount, s as resolveWhatsAppMediaMaxBytes } from "./accounts-BPYgj8Fv.js";
|
|
4
|
+
import { n as isWhatsAppNewsletterJid } from "./normalize-target-bVWjgftN.js";
|
|
5
|
+
import { t as getRegisteredWhatsAppConnectionController } from "./connection-controller-registry-TSX_udJp.js";
|
|
6
|
+
import { a as resolveWhatsAppOutboundMediaUrls, i as prepareWhatsAppOutboundMedia, n as normalizeWhatsAppPayloadText, s as resolveWhatsAppDocumentFileName } from "./outbound-media-contract-ioTkt8tn.js";
|
|
7
|
+
import "./normalize-Bxwqo-bW.js";
|
|
8
|
+
import { d as markdownToWhatsApp, p as toWhatsappJid } from "./text-runtime-Dk37KYHj.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,9 +1,9 @@
|
|
|
1
|
-
import { n as isWhatsAppNewsletterJid } from "./normalize-target-
|
|
2
|
-
import { s as resolveWhatsAppDocumentFileName } from "./outbound-media-contract-
|
|
3
|
-
import "./normalize-
|
|
4
|
-
import { m as toWhatsappJidWithLid, p as toWhatsappJid, u as jidToE164 } from "./text-runtime-
|
|
5
|
-
import { t as buildQuotedMessageOptions } from "./quoted-message-
|
|
6
|
-
import { c as resolveComparableIdentity } from "./identity-
|
|
1
|
+
import { n as isWhatsAppNewsletterJid } from "./normalize-target-bVWjgftN.js";
|
|
2
|
+
import { s as resolveWhatsAppDocumentFileName } from "./outbound-media-contract-ioTkt8tn.js";
|
|
3
|
+
import "./normalize-Bxwqo-bW.js";
|
|
4
|
+
import { m as toWhatsappJidWithLid, p as toWhatsappJid, u as jidToE164 } from "./text-runtime-Dk37KYHj.js";
|
|
5
|
+
import { t as buildQuotedMessageOptions } from "./quoted-message-CveINB35.js";
|
|
6
|
+
import { c as resolveComparableIdentity } from "./identity-xoLLdqEv.js";
|
|
7
7
|
import { normalizeLowercaseStringOrEmpty } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
8
8
|
import { logVerbose } from "openclaw/plugin-sdk/runtime-env";
|
|
9
9
|
import { createMessageReceiptFromOutboundResults, listMessageReceiptPlatformIds } from "openclaw/plugin-sdk/channel-message";
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { n as getStatusCode } from "./session-errors-
|
|
3
|
-
import { S as enqueueCredsSave, T as writeCredsJsonAtomically, b as restoreCredsFromBackupIfNeeded, u as readCredsJsonRaw, w as waitForCredsSaveQueueWithTimeout, y as resolveDefaultWebAuthDir } from "./auth-store-
|
|
4
|
-
import { i as makeWASocket, n as fetchLatestBaileysVersion, o as useMultiFileAuthState, r as makeCacheableSignalKeyStore, t as DisconnectReason } from "./session.runtime-
|
|
5
|
-
import fs from "node:fs";
|
|
1
|
+
import { o as resolveWebCredsBackupPath, s as resolveWebCredsPath, t as assertWebCredsPathRegularFileOrMissing } from "./creds-files-B1kSWtBg.js";
|
|
2
|
+
import { n as getStatusCode } from "./session-errors-BAj9D2La.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-GTQvJznL.js";
|
|
4
|
+
import { i as makeWASocket, n as fetchLatestBaileysVersion, o as useMultiFileAuthState, r as makeCacheableSignalKeyStore, t as DisconnectReason } from "./session.runtime-C6uBkEaI.js";
|
|
6
5
|
import { VERSION, formatCliCommand } from "openclaw/plugin-sdk/cli-runtime";
|
|
7
6
|
import { danger, getChildLogger, success, toPinoLikeLogger } from "openclaw/plugin-sdk/runtime-env";
|
|
8
7
|
import { renderQrTerminal } from "openclaw/plugin-sdk/media-runtime";
|
|
@@ -32,6 +31,9 @@ function resolveWhatsAppSocketTiming(cfg, overrides) {
|
|
|
32
31
|
const LOGGED_OUT_STATUS = DisconnectReason?.loggedOut ?? 401;
|
|
33
32
|
const WHATSAPP_WEBSOCKET_PROXY_TARGET = "https://mmg.whatsapp.net/";
|
|
34
33
|
const CREDS_FLUSH_TIMEOUT_MESSAGE = "Queued WhatsApp creds save did not finish before auth bootstrap; skipping repair and continuing with primary creds.";
|
|
34
|
+
async function rejectUnsafeWebCredsPath(authDir) {
|
|
35
|
+
await assertWebCredsPathRegularFileOrMissing(resolveWebCredsPath(authDir));
|
|
36
|
+
}
|
|
35
37
|
function enqueueSaveCreds(authDir, saveCreds, logger) {
|
|
36
38
|
enqueueCredsSave(authDir, () => safeSaveCreds(authDir, saveCreds, logger), (err) => {
|
|
37
39
|
logger.warn({ error: String(err) }, "WhatsApp creds save queue error");
|
|
@@ -44,10 +46,11 @@ async function safeSaveCreds(authDir, saveCreds, logger) {
|
|
|
44
46
|
const raw = readCredsJsonRaw(credsPath);
|
|
45
47
|
if (raw) try {
|
|
46
48
|
JSON.parse(raw);
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
49
|
+
await writeWebCredsRawAtomically({
|
|
50
|
+
filePath: backupPath,
|
|
51
|
+
content: raw,
|
|
52
|
+
tempPrefix: ".creds.backup"
|
|
53
|
+
});
|
|
51
54
|
} catch {}
|
|
52
55
|
} catch {}
|
|
53
56
|
try {
|
|
@@ -67,10 +70,15 @@ async function printTerminalQr(qr) {
|
|
|
67
70
|
async function createWaSocket(printQr, verbose, opts = {}) {
|
|
68
71
|
const logger = toPinoLikeLogger(getChildLogger({ module: "baileys" }, { level: verbose ? "info" : "silent" }), verbose ? "info" : "silent");
|
|
69
72
|
const authDir = resolveUserPath(opts.authDir ?? resolveDefaultWebAuthDir());
|
|
73
|
+
await rejectUnsafeWebCredsPath(authDir);
|
|
70
74
|
await ensureDir(authDir);
|
|
71
75
|
const sessionLogger = getChildLogger({ module: "web-session" });
|
|
72
76
|
if (await waitForCredsSaveQueueWithTimeout(authDir) === "timed_out") sessionLogger.warn({ authDir }, CREDS_FLUSH_TIMEOUT_MESSAGE);
|
|
73
|
-
else
|
|
77
|
+
else {
|
|
78
|
+
await rejectUnsafeWebCredsPath(authDir);
|
|
79
|
+
await restoreCredsFromBackupIfNeeded(authDir);
|
|
80
|
+
}
|
|
81
|
+
await rejectUnsafeWebCredsPath(authDir);
|
|
74
82
|
const { state } = await useMultiFileAuthState(authDir);
|
|
75
83
|
const saveCreds = async () => {
|
|
76
84
|
await writeCredsJsonAtomically(authDir, state.creds);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as __exportAll } from "./rolldown-runtime-
|
|
1
|
+
import { t as __exportAll } from "./rolldown-runtime-D7D4PA-g.js";
|
|
2
2
|
import { BufferJSON, DisconnectReason as DisconnectReason$1, fetchLatestBaileysVersion, makeCacheableSignalKeyStore, makeWASocket, useMultiFileAuthState } from "baileys";
|
|
3
3
|
//#region extensions/whatsapp/src/session.runtime.ts
|
|
4
4
|
var session_runtime_exports = /* @__PURE__ */ __exportAll({
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { r as resolveDefaultWhatsAppAccountId, t as listAccountIds } from "./account-ids-
|
|
2
|
-
import { a as resolveWhatsAppAccount, n as hasAnyWhatsAppAuth } from "./accounts-
|
|
3
|
-
import { a as normalizeWhatsAppAllowFromEntries } from "./normalize-target-
|
|
4
|
-
import { t as WhatsAppChannelConfigSchema } from "./config-schema-
|
|
5
|
-
import { n as whatsappDoctor } from "./doctor-
|
|
6
|
-
import { t as resolveLegacyGroupSessionKey } from "./group-session-contract-
|
|
7
|
-
import { n as unsupportedSecretRefSurfacePatterns, t as collectUnsupportedSecretRefConfigCandidates } from "./security-contract-
|
|
8
|
-
import { n as deriveLegacySessionChatType, r as isLegacyGroupSessionKey, t as canonicalizeLegacySessionKey } from "./session-contract-
|
|
1
|
+
import { r as resolveDefaultWhatsAppAccountId, t as listAccountIds } from "./account-ids-CB5SOWjc.js";
|
|
2
|
+
import { a as resolveWhatsAppAccount, n as hasAnyWhatsAppAuth } from "./accounts-BPYgj8Fv.js";
|
|
3
|
+
import { a as normalizeWhatsAppAllowFromEntries } from "./normalize-target-bVWjgftN.js";
|
|
4
|
+
import { t as WhatsAppChannelConfigSchema } from "./config-schema-CsNDlDpL.js";
|
|
5
|
+
import { n as whatsappDoctor } from "./doctor-By3SB4lm.js";
|
|
6
|
+
import { t as resolveLegacyGroupSessionKey } from "./group-session-contract-DDnZSsJ1.js";
|
|
7
|
+
import { n as unsupportedSecretRefSurfacePatterns, t as collectUnsupportedSecretRefConfigCandidates } from "./security-contract-nAzD945y.js";
|
|
8
|
+
import { n as deriveLegacySessionChatType, r as isLegacyGroupSessionKey, t as canonicalizeLegacySessionKey } from "./session-contract-DMTm6Q_L.js";
|
|
9
9
|
import { DEFAULT_ACCOUNT_ID } from "openclaw/plugin-sdk/account-core";
|
|
10
10
|
import { normalizeE164 } from "openclaw/plugin-sdk/account-resolution";
|
|
11
11
|
import { createChannelPluginBase, getChatChannelMeta } from "openclaw/plugin-sdk/core";
|
|
@@ -125,10 +125,10 @@ function resolveWhatsAppConfigPath(params) {
|
|
|
125
125
|
return `${resolveWhatsAppGroupScopeBasePath(params)}.${params.field}`;
|
|
126
126
|
}
|
|
127
127
|
async function loadWhatsAppChannelRuntime() {
|
|
128
|
-
return await import("./channel.runtime-
|
|
128
|
+
return await import("./channel.runtime-BBPZSziE.js");
|
|
129
129
|
}
|
|
130
130
|
async function loadWhatsAppSetupSurface() {
|
|
131
|
-
return await import("./setup-surface-
|
|
131
|
+
return await import("./setup-surface-DqY0LqAY.js");
|
|
132
132
|
}
|
|
133
133
|
const whatsappSetupWizardProxy = createWhatsAppSetupWizardProxy(async () => (await loadWhatsAppSetupSurface()).whatsappSetupWizard);
|
|
134
134
|
const whatsappConfigAdapter = createScopedChannelConfigAdapter({
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { r as resolveDefaultWhatsAppAccountId } from "./account-ids-
|
|
2
|
-
import {
|
|
3
|
-
import { a as
|
|
4
|
-
import {
|
|
5
|
-
import
|
|
6
|
-
import { DEFAULT_ACCOUNT_ID, createSetupTranslator,
|
|
1
|
+
import { r as resolveDefaultWhatsAppAccountId } from "./account-ids-CB5SOWjc.js";
|
|
2
|
+
import { r as hasWebCredsSync } from "./creds-files-B1kSWtBg.js";
|
|
3
|
+
import { a as resolveWhatsAppAccount, o as resolveWhatsAppAuthDir } from "./accounts-BPYgj8Fv.js";
|
|
4
|
+
import { a as normalizeWhatsAppAllowFromEntries, o as normalizeWhatsAppAllowFromEntry } from "./normalize-target-bVWjgftN.js";
|
|
5
|
+
import { t as whatsappSetupAdapter } from "./setup-core-Dm1hsI3r.js";
|
|
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
|
|
9
9
|
const t = createSetupTranslator();
|
|
@@ -89,7 +89,7 @@ async function detectWhatsAppLinked(cfg, accountId) {
|
|
|
89
89
|
cfg,
|
|
90
90
|
accountId
|
|
91
91
|
});
|
|
92
|
-
return
|
|
92
|
+
return hasWebCredsSync(authDir);
|
|
93
93
|
}
|
|
94
94
|
async function promptWhatsAppOwnerAllowFrom(params) {
|
|
95
95
|
const { prompter, existingAllowFrom } = params;
|
|
@@ -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-nJwaNuC-.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-BDH3Mk5M.js";
|
|
2
2
|
export { whatsappSetupPlugin };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { t as listAccountIds } from "./account-ids-
|
|
2
|
-
import { o as resolveWhatsAppAuthDir } from "./accounts-
|
|
3
|
-
import { a as formatWhatsAppWebAuthStatusState, h as readWebAuthState } from "./auth-store-
|
|
1
|
+
import { t as listAccountIds } from "./account-ids-CB5SOWjc.js";
|
|
2
|
+
import { o as resolveWhatsAppAuthDir } from "./accounts-BPYgj8Fv.js";
|
|
3
|
+
import { a as formatWhatsAppWebAuthStatusState, h as readWebAuthState } from "./auth-store-GTQvJznL.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-BlTQrUj9.js")).finalizeWhatsAppSetup(params),
|
|
40
40
|
disable: (cfg) => setSetupChannelEnabled(cfg, channel, false),
|
|
41
41
|
onAccountRecorded: (accountId, options) => {
|
|
42
42
|
options?.onAccountId?.(channel, accountId);
|
package/dist/targets.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { c as normalizeWhatsAppTarget, r as isWhatsAppUserTarget, t as isWhatsAppGroupJid } from "./normalize-target-
|
|
1
|
+
import { c as normalizeWhatsAppTarget, r as isWhatsAppUserTarget, t as isWhatsAppGroupJid } from "./normalize-target-bVWjgftN.js";
|
|
2
2
|
export { isWhatsAppGroupJid, isWhatsAppUserTarget, normalizeWhatsAppTarget };
|
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-DeSRFXEV.js";
|
|
2
|
+
import { t as whatsappOutbound } from "./outbound-adapter-ltiZkW9L.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.20-beta.2",
|
|
4
4
|
"description": "OpenClaw WhatsApp channel plugin",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
"type": "module",
|
|
10
10
|
"dependencies": {
|
|
11
11
|
"audio-decode": "2.2.3",
|
|
12
|
-
"baileys": "7.0.0-
|
|
12
|
+
"baileys": "7.0.0-rc12",
|
|
13
13
|
"https-proxy-agent": "9.0.0",
|
|
14
14
|
"jimp": "1.6.1",
|
|
15
15
|
"typebox": "1.1.38"
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
"openclaw": "workspace:*"
|
|
20
20
|
},
|
|
21
21
|
"peerDependencies": {
|
|
22
|
-
"openclaw": ">=2026.5.
|
|
22
|
+
"openclaw": ">=2026.5.20-beta.2"
|
|
23
23
|
},
|
|
24
24
|
"peerDependenciesMeta": {
|
|
25
25
|
"openclaw": {
|
|
@@ -62,10 +62,10 @@
|
|
|
62
62
|
"minHostVersion": ">=2026.4.25"
|
|
63
63
|
},
|
|
64
64
|
"compat": {
|
|
65
|
-
"pluginApi": ">=2026.5.
|
|
65
|
+
"pluginApi": ">=2026.5.20-beta.2"
|
|
66
66
|
},
|
|
67
67
|
"build": {
|
|
68
|
-
"openclawVersion": "2026.5.
|
|
68
|
+
"openclawVersion": "2026.5.20-beta.2"
|
|
69
69
|
},
|
|
70
70
|
"release": {
|
|
71
71
|
"publishToClawHub": true,
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import fs from "node:fs";
|
|
2
|
-
import path from "node:path";
|
|
3
|
-
//#region extensions/whatsapp/src/creds-files.ts
|
|
4
|
-
function resolveWebCredsPath(authDir) {
|
|
5
|
-
return path.join(authDir, "creds.json");
|
|
6
|
-
}
|
|
7
|
-
function resolveWebCredsBackupPath(authDir) {
|
|
8
|
-
return path.join(authDir, "creds.json.bak");
|
|
9
|
-
}
|
|
10
|
-
function hasWebCredsSync(authDir) {
|
|
11
|
-
try {
|
|
12
|
-
const stats = fs.statSync(resolveWebCredsPath(authDir));
|
|
13
|
-
return stats.isFile() && stats.size > 1;
|
|
14
|
-
} catch {
|
|
15
|
-
return false;
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
//#endregion
|
|
19
|
-
export { resolveWebCredsBackupPath as n, resolveWebCredsPath as r, hasWebCredsSync 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
|
|
File without changes
|
|
File without changes
|