@openclaw/whatsapp 2026.7.2-beta.3 → 2026.7.2-beta.5
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/README.md +1 -1
- package/dist/{access-control-tjy_em01.js → access-control-pZcxTmd5.js} +4 -5
- package/dist/{accounts-ejK8sXPU.js → accounts-CSqLvCY5.js} +1 -2
- package/dist/{action-runtime-p0V390gA.js → action-runtime-B2bNDUwE.js} +3 -3
- package/dist/action-runtime-api.js +1 -1
- package/dist/action-runtime.runtime.js +1 -1
- package/dist/{active-listener-BbdlXooT.js → active-listener-BEjWsCNM.js} +1 -1
- package/dist/api.js +13 -22
- package/dist/{approval-handler.runtime-BO1oJ-b8.js → approval-handler.runtime-CmtqgLSQ.js} +6 -6
- package/dist/{approval-reactions-CrZFAyf-.js → approval-reactions-Cu66aYdq.js} +4 -4
- package/dist/{auth-store-BQi9pZqQ.js → auth-store-DcEpIOmE.js} +4 -3
- package/dist/call-tool-api.js +4 -4
- package/dist/{channel-B2I4Opzb.js → channel-DcWBc3Hb.js} +39 -67
- package/dist/channel-config-api.js +1 -1
- package/dist/channel-plugin-api.js +1 -1
- package/dist/{channel-react-action-CPRQE-s3.js → channel-react-action-DUIkjl6w.js} +12 -15
- package/dist/{channel.runtime-CjkhQzk8.js → channel.runtime-Q5fJ2I2b.js} +5 -5
- package/dist/{channel.setup-BMWE9LmN.js → channel.setup-C_1u6HN6.js} +3 -6
- package/dist/{config-schema-BZ8h1hWA.js → config-schema-DARep0Nn.js} +7 -5
- package/dist/{connection-controller-HGaffeFb.js → connection-controller-BOB2MVKY.js} +8 -10
- package/dist/{connection-controller-runtime-context-9mEeAvu1.js → connection-controller-runtime-context-DG0tuYuw.js} +3 -3
- package/dist/contract-api.js +2 -2
- package/dist/{directory-config-BZ775eGX.js → directory-config-DalGrfGN.js} +7 -7
- package/dist/directory-contract-api.js +1 -1
- package/dist/doctor-CwzVXKoE.js +10 -0
- package/dist/doctor-contract-api.js +35 -79
- package/dist/{group-session-key-Dh8WZun_.js → group-session-key-DVMZlO3x.js} +11 -6
- package/dist/{identity-D7L8LCuH.js → identity-CPrT5aEU.js} +2 -2
- package/dist/light-runtime-api.js +2 -2
- package/dist/{login-ifOXCBjo.js → login-CvY2Dhch.js} +6 -7
- package/dist/{login-qr-DUHzVH_Y.js → login-qr-Bncpb6js.js} +7 -8
- package/dist/login-qr-runtime.js +1 -1
- package/dist/{monitor-_jqDKBXj.js → monitor-B7phZF9w.js} +427 -525
- package/dist/normalize-C7Hkc_vE.js +2 -0
- package/dist/{normalize-target-DSZnHkKF.js → normalize-target-CugRyONv.js} +6 -2
- package/dist/{question-reactions-C0qJ6wGA.js → question-reactions-CRsnyoMK.js} +1 -1
- package/dist/{resolve-outbound-target-BR97fAbB.js → resolve-outbound-target-1GqbT1uX.js} +1 -1
- package/dist/runtime-BLlToOi6.js +21 -0
- package/dist/runtime-api.js +10 -10
- package/dist/runtime-setter-api.js +1 -1
- package/dist/{send-SB-4JrVZ.js → send-BTXJAyK4.js} +40 -86
- package/dist/{send-api-BG0MgoFI.js → send-api-BY_AkSiB.js} +41 -35
- package/dist/{setup-finalize-Cc-4iWGj.js → setup-finalize-C-m-vCl9.js} +4 -4
- package/dist/setup-plugin-api.js +1 -1
- package/dist/{setup-surface-DhnXEZir.js → setup-surface-BjvUbR6M.js} +3 -3
- package/dist/{setup-core-BbIgEl2M.js → shared-UcAwtJaq.js} +79 -57
- package/dist/{socket-close-jNGyZY4T.js → socket-close-DridEuzz.js} +5 -6
- package/dist/{targets-runtime-Bsh0HR9y.js → targets-runtime-TMk0lGuy.js} +133 -29
- package/dist/text-runtime-CaKLhowd.js +4 -0
- package/node_modules/@protobufjs/utf8/CHANGELOG.md +8 -0
- package/node_modules/@protobufjs/utf8/index.js +29 -18
- package/node_modules/@protobufjs/utf8/package.json +2 -2
- package/node_modules/@protobufjs/utf8/tests/index.js +5 -0
- package/node_modules/@thi.ng/bitstream/package.json +4 -4
- package/node_modules/@thi.ng/errors/package.json +4 -4
- package/node_modules/@types/node/README.md +1 -1
- package/node_modules/@types/node/fs/promises.d.ts +16 -6
- package/node_modules/@types/node/package.json +2 -2
- package/node_modules/audio-type/package.json +3 -2
- package/node_modules/lru-cache/dist/commonjs/browser/index.d.ts.map +1 -1
- package/node_modules/lru-cache/dist/commonjs/browser/index.js +11 -4
- package/node_modules/lru-cache/dist/commonjs/browser/index.js.map +1 -1
- package/node_modules/lru-cache/dist/commonjs/browser/index.min.js +1 -1
- package/node_modules/lru-cache/dist/commonjs/browser/index.min.js.map +3 -3
- package/node_modules/lru-cache/dist/commonjs/index.d.ts.map +1 -1
- package/node_modules/lru-cache/dist/commonjs/index.js +11 -4
- package/node_modules/lru-cache/dist/commonjs/index.js.map +1 -1
- package/node_modules/lru-cache/dist/commonjs/index.min.js +1 -1
- package/node_modules/lru-cache/dist/commonjs/index.min.js.map +3 -3
- package/node_modules/lru-cache/dist/commonjs/node/index.d.ts.map +1 -1
- package/node_modules/lru-cache/dist/commonjs/node/index.js +11 -4
- package/node_modules/lru-cache/dist/commonjs/node/index.js.map +1 -1
- package/node_modules/lru-cache/dist/commonjs/node/index.min.js +1 -1
- package/node_modules/lru-cache/dist/commonjs/node/index.min.js.map +3 -3
- package/node_modules/lru-cache/dist/esm/browser/index.d.ts.map +1 -1
- package/node_modules/lru-cache/dist/esm/browser/index.js +11 -4
- package/node_modules/lru-cache/dist/esm/browser/index.js.map +1 -1
- package/node_modules/lru-cache/dist/esm/browser/index.min.js +1 -1
- package/node_modules/lru-cache/dist/esm/browser/index.min.js.map +3 -3
- package/node_modules/lru-cache/dist/esm/index.d.ts.map +1 -1
- package/node_modules/lru-cache/dist/esm/index.js +11 -4
- package/node_modules/lru-cache/dist/esm/index.js.map +1 -1
- package/node_modules/lru-cache/dist/esm/index.min.js +1 -1
- package/node_modules/lru-cache/dist/esm/index.min.js.map +3 -3
- package/node_modules/lru-cache/dist/esm/node/index.d.ts.map +1 -1
- package/node_modules/lru-cache/dist/esm/node/index.js +11 -4
- package/node_modules/lru-cache/dist/esm/node/index.js.map +1 -1
- package/node_modules/lru-cache/dist/esm/node/index.min.js +1 -1
- package/node_modules/lru-cache/dist/esm/node/index.min.js.map +3 -3
- package/node_modules/lru-cache/package.json +1 -1
- package/node_modules/music-metadata/lib/common/Util.d.ts +1 -1
- package/node_modules/music-metadata/lib/common/Util.js +7 -1
- package/node_modules/music-metadata/lib/id3v2/FrameHeader.js +23 -3
- package/node_modules/music-metadata/lib/id3v2/FrameParser.js +2 -2
- package/node_modules/music-metadata/lib/id3v2/ID3v2Token.js +1 -1
- package/node_modules/music-metadata/lib/mp4/AtomToken.js +38 -13
- package/node_modules/music-metadata/lib/mpeg/MpegParser.js +1 -1
- package/node_modules/music-metadata/package.json +6 -6
- package/node_modules/p-queue/dist/index.js +17 -6
- package/node_modules/p-queue/package.json +1 -1
- package/node_modules/protobufjs/dist/light/protobuf.js +145 -188
- package/node_modules/protobufjs/dist/light/protobuf.js.map +1 -1
- package/node_modules/protobufjs/dist/light/protobuf.min.js +3 -3
- package/node_modules/protobufjs/dist/light/protobuf.min.js.map +1 -1
- package/node_modules/protobufjs/dist/minimal/protobuf.js +33 -76
- package/node_modules/protobufjs/dist/minimal/protobuf.js.map +1 -1
- package/node_modules/protobufjs/dist/minimal/protobuf.min.js +3 -3
- package/node_modules/protobufjs/dist/minimal/protobuf.min.js.map +1 -1
- package/node_modules/protobufjs/dist/protobuf.js +168 -208
- package/node_modules/protobufjs/dist/protobuf.js.map +1 -1
- package/node_modules/protobufjs/dist/protobuf.min.js +3 -3
- package/node_modules/protobufjs/dist/protobuf.min.js.map +1 -1
- package/node_modules/protobufjs/index.d.ts +0 -8
- package/node_modules/protobufjs/package.json +2 -3
- package/node_modules/protobufjs/src/parse.js +3 -0
- package/node_modules/protobufjs/src/util/minimal.js +0 -3
- package/node_modules/typebox/build/compile/validator.d.mts +1 -4
- package/node_modules/typebox/build/guard/guard.d.mts +1 -1
- package/node_modules/typebox/build/guard/guard.mjs +5 -2
- package/node_modules/typebox/build/guard/string.mjs +16 -4
- package/node_modules/typebox/build/schema/engine/_functions.mjs +34 -15
- package/node_modules/typebox/build/type/action/readonly_object.d.mts +5 -0
- package/node_modules/typebox/build/type/action/readonly_object.mjs +8 -0
- package/node_modules/typebox/build/typebox.d.mts +1 -1
- package/node_modules/typebox/build/typebox.mjs +1 -1
- package/node_modules/typebox/package.json +1 -1
- package/node_modules/typebox/readme.md +29 -32
- package/node_modules/ws/lib/receiver.js +15 -32
- package/node_modules/ws/lib/websocket-server.js +4 -4
- package/node_modules/ws/lib/websocket.js +4 -4
- package/node_modules/ws/package.json +5 -1
- package/openclaw.plugin.json +138 -194
- package/package.json +21 -12
- package/dist/doctor-By3SB4lm.js +0 -48
- package/dist/normalize-C-Z16y7Q.js +0 -2
- package/dist/runtime-BfAdAEYT.js +0 -8
- package/dist/text-runtime-BTGkMN0o.js +0 -4
- package/node_modules/@protobufjs/inquire/CHANGELOG.md +0 -8
- package/node_modules/@protobufjs/inquire/LICENSE +0 -26
- package/node_modules/@protobufjs/inquire/README.md +0 -13
- package/node_modules/@protobufjs/inquire/index.d.ts +0 -10
- package/node_modules/@protobufjs/inquire/index.js +0 -38
- package/node_modules/@protobufjs/inquire/package.json +0 -21
- package/node_modules/@protobufjs/inquire/tests/data/array.js +0 -1
- package/node_modules/@protobufjs/inquire/tests/data/emptyArray.js +0 -1
- package/node_modules/@protobufjs/inquire/tests/data/emptyObject.js +0 -1
- package/node_modules/@protobufjs/inquire/tests/data/object.js +0 -1
- package/node_modules/@protobufjs/inquire/tests/index.js +0 -20
- package/npm-shrinkwrap.json +0 -958
package/README.md
CHANGED
|
@@ -5,7 +5,7 @@ Official OpenClaw channel plugin for WhatsApp Web chats.
|
|
|
5
5
|
Install from OpenClaw:
|
|
6
6
|
|
|
7
7
|
```bash
|
|
8
|
-
openclaw
|
|
8
|
+
openclaw plugins install @openclaw/whatsapp
|
|
9
9
|
```
|
|
10
10
|
|
|
11
11
|
Link a WhatsApp account through the plugin's setup flow, then configure which chats OpenClaw agents should monitor and reply to.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { a as resolveWhatsAppAccount } from "./accounts-
|
|
2
|
-
import { n as isSelfChatMode } from "./targets-runtime-
|
|
3
|
-
import {
|
|
4
|
-
import { a as getSelfIdentity, o as getSenderIdentity } from "./identity-
|
|
1
|
+
import { a as resolveWhatsAppAccount } from "./accounts-CSqLvCY5.js";
|
|
2
|
+
import { n as isSelfChatMode } from "./targets-runtime-TMk0lGuy.js";
|
|
3
|
+
import { t as normalizeE164 } from "./text-runtime-CaKLhowd.js";
|
|
4
|
+
import { a as getSelfIdentity, o as getSenderIdentity } from "./identity-CPrT5aEU.js";
|
|
5
5
|
import { defaultRuntime } from "openclaw/plugin-sdk/runtime-env";
|
|
6
6
|
import { resolveChannelGroupPolicy, resolveChannelGroupRequireMention } from "openclaw/plugin-sdk/channel-policy";
|
|
7
7
|
import { createChannelPairingChallengeIssuer } from "openclaw/plugin-sdk/channel-pairing";
|
|
@@ -233,7 +233,6 @@ async function resolveWhatsAppIngressAccess(params) {
|
|
|
233
233
|
});
|
|
234
234
|
}
|
|
235
235
|
async function resolveWhatsAppCommandAuthorized(params) {
|
|
236
|
-
if (!(params.cfg.commands?.useAccessGroups !== false)) return true;
|
|
237
236
|
const self = getSelfIdentity(params.msg, params.authDir);
|
|
238
237
|
const admission = requireWhatsAppInboundAdmission(params.msg);
|
|
239
238
|
const policy = params.policy ?? resolveWhatsAppInboundPolicy({
|
|
@@ -117,7 +117,7 @@ function resolveWhatsAppAccount(params) {
|
|
|
117
117
|
name: normalizeOptionalString(merged.name),
|
|
118
118
|
enabled,
|
|
119
119
|
sendReadReceipts: merged.sendReadReceipts ?? true,
|
|
120
|
-
messagePrefix: merged.
|
|
120
|
+
messagePrefix: merged.responsePrefix,
|
|
121
121
|
defaultTo: merged.defaultTo,
|
|
122
122
|
authDir,
|
|
123
123
|
isLegacyAuthDir: isLegacy,
|
|
@@ -135,7 +135,6 @@ function resolveWhatsAppAccount(params) {
|
|
|
135
135
|
reactionLevel: merged.reactionLevel,
|
|
136
136
|
groups: merged.groups,
|
|
137
137
|
direct: merged.direct,
|
|
138
|
-
debounceMs: merged.debounceMs,
|
|
139
138
|
replyToMode: merged.replyToMode
|
|
140
139
|
};
|
|
141
140
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { a as resolveWhatsAppAccount } from "./accounts-
|
|
2
|
-
import { t as resolveWhatsAppOutboundTarget } from "./resolve-outbound-target-
|
|
3
|
-
import { r as sendReactionWhatsApp, u as resolveWhatsAppReactionLevel } from "./send-
|
|
1
|
+
import { a as resolveWhatsAppAccount } from "./accounts-CSqLvCY5.js";
|
|
2
|
+
import { t as resolveWhatsAppOutboundTarget } from "./resolve-outbound-target-1GqbT1uX.js";
|
|
3
|
+
import { r as sendReactionWhatsApp, u as resolveWhatsAppReactionLevel } from "./send-BTXJAyK4.js";
|
|
4
4
|
import { ToolAuthorizationError, createActionGate, jsonResult, readReactionParams, readStringParam } from "openclaw/plugin-sdk/channel-actions";
|
|
5
5
|
//#region extensions/whatsapp/src/action-runtime-target-auth.ts
|
|
6
6
|
function resolveAuthorizedWhatsAppOutboundTarget(params) {
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as handleWhatsAppAction } from "./action-runtime-
|
|
1
|
+
import { t as handleWhatsAppAction } from "./action-runtime-B2bNDUwE.js";
|
|
2
2
|
export { handleWhatsAppAction };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as handleWhatsAppAction } from "./action-runtime-
|
|
1
|
+
import { t as handleWhatsAppAction } from "./action-runtime-B2bNDUwE.js";
|
|
2
2
|
export { handleWhatsAppAction };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { r as resolveDefaultWhatsAppAccountId } from "./account-ids-CB5SOWjc.js";
|
|
2
|
-
import { r as getWhatsAppConnectionController } from "./connection-controller-runtime-context-
|
|
2
|
+
import { r as getWhatsAppConnectionController } from "./connection-controller-runtime-context-DG0tuYuw.js";
|
|
3
3
|
//#region extensions/whatsapp/src/active-listener.ts
|
|
4
4
|
function resolveWebAccountId(params) {
|
|
5
5
|
return (params.accountId ?? "").trim() || resolveDefaultWhatsAppAccountId(params.cfg);
|
package/dist/api.js
CHANGED
|
@@ -1,29 +1,20 @@
|
|
|
1
|
-
import { a as resolveWhatsAppAccount, i as listWhatsAppAuthDirs, n as hasAnyWhatsAppAuth, o as resolveWhatsAppAuthDir, r as listEnabledWhatsAppAccounts, s as resolveWhatsAppMediaMaxBytes, t as DEFAULT_WHATSAPP_MEDIA_MAX_MB } from "./accounts-
|
|
1
|
+
import { a as resolveWhatsAppAccount, i as listWhatsAppAuthDirs, n as hasAnyWhatsAppAuth, o as resolveWhatsAppAuthDir, r as listEnabledWhatsAppAccounts, s as resolveWhatsAppMediaMaxBytes, t as DEFAULT_WHATSAPP_MEDIA_MAX_MB } from "./accounts-CSqLvCY5.js";
|
|
2
2
|
import { r as resolveDefaultWhatsAppAccountId, t as listAccountIds } from "./account-ids-CB5SOWjc.js";
|
|
3
|
-
import { a as normalizeWhatsAppAllowFromEntries, c as normalizeWhatsAppTarget, i as looksLikeWhatsAppTargetId, r as isWhatsAppUserTarget, s as normalizeWhatsAppMessagingTarget, t as isWhatsAppGroupJid } from "./normalize-target-
|
|
4
|
-
import { t as resolveWhatsAppOutboundTarget } from "./resolve-outbound-target-
|
|
5
|
-
import "./
|
|
6
|
-
import {
|
|
7
|
-
import { n as
|
|
8
|
-
import {
|
|
3
|
+
import { a as normalizeWhatsAppAllowFromEntries, c as normalizeWhatsAppTarget, i as looksLikeWhatsAppTargetId, r as isWhatsAppUserTarget, s as normalizeWhatsAppMessagingTarget, t as isWhatsAppGroupJid } from "./normalize-target-CugRyONv.js";
|
|
4
|
+
import { t as resolveWhatsAppOutboundTarget } from "./resolve-outbound-target-1GqbT1uX.js";
|
|
5
|
+
import { c as toWhatsappJid, i as markdownToWhatsApp, l as toWhatsappJidWithLid, n as isSelfChatMode, r as jidToE164, s as resolveJidToE164, t as assertWebChannel } from "./targets-runtime-TMk0lGuy.js";
|
|
6
|
+
import { n as resolveUserPath, t as normalizeE164 } from "./text-runtime-CaKLhowd.js";
|
|
7
|
+
import { n as WHATSAPP_LEGACY_OUTBOUND_SEND_DEP_KEYS, t as whatsappPlugin } from "./channel-DcWBc3Hb.js";
|
|
8
|
+
import { a as resolveWhatsAppGroupRequireMention, o as resolveWhatsAppGroupToolPolicy } from "./shared-UcAwtJaq.js";
|
|
9
9
|
import { t as whatsappCommandPolicy } from "./command-policy-BIOSHySD.js";
|
|
10
|
-
import {
|
|
11
|
-
import "./config-schema-BZ8h1hWA.js";
|
|
12
|
-
import { t as whatsappSetupPlugin } from "./channel.setup-BMWE9LmN.js";
|
|
10
|
+
import { t as whatsappSetupPlugin } from "./channel.setup-C_1u6HN6.js";
|
|
13
11
|
import { t as DEFAULT_WEB_MEDIA_BYTES } from "./constants-HU41RHGI.js";
|
|
14
|
-
import { a as waitForWaConnection, o as DEFAULT_WHATSAPP_SOCKET_TIMING, r as createWaSocket, s as createWhatsAppSocketOperationTimeoutAdapter } from "./socket-close-
|
|
12
|
+
import { a as waitForWaConnection, o as DEFAULT_WHATSAPP_SOCKET_TIMING, r as createWaSocket, s as createWhatsAppSocketOperationTimeoutAdapter } from "./socket-close-DridEuzz.js";
|
|
15
13
|
import { n as getStatusCode, t as formatError } from "./session-errors-JuazczrA.js";
|
|
16
|
-
import { n as listWhatsAppDirectoryGroupsFromConfig, r as listWhatsAppDirectoryPeersFromConfig } from "./directory-config-
|
|
17
|
-
import { n as testing } from "./access-control-
|
|
18
|
-
import {
|
|
19
|
-
import "openclaw/plugin-sdk/channel-actions";
|
|
20
|
-
import "openclaw/plugin-sdk/account-resolution";
|
|
21
|
-
import "openclaw/plugin-sdk/core";
|
|
22
|
-
import "openclaw/plugin-sdk/account-id";
|
|
23
|
-
import { createLazyRuntimeModule } from "openclaw/plugin-sdk/lazy-runtime";
|
|
14
|
+
import { n as listWhatsAppDirectoryGroupsFromConfig, r as listWhatsAppDirectoryPeersFromConfig } from "./directory-config-DalGrfGN.js";
|
|
15
|
+
import { n as testing } from "./access-control-pZcxTmd5.js";
|
|
16
|
+
import { d as normalizeMessageContent, f as describeReplyContext, g as extractLocationData, m as extractContextInfo, t as createWebSendApi, x as resolveInboundMediaMimetype, y as extractText } from "./send-api-BY_AkSiB.js";
|
|
24
17
|
import { formatLocationText } from "openclaw/plugin-sdk/channel-inbound";
|
|
25
|
-
createLazyRuntimeModule(() => import("./channel.runtime-CjkhQzk8.js"));
|
|
26
|
-
//#endregion
|
|
27
18
|
//#region extensions/whatsapp/src/qa-driver.runtime.ts
|
|
28
19
|
function isRecord(value) {
|
|
29
20
|
return Boolean(value && typeof value === "object");
|
|
@@ -312,4 +303,4 @@ async function startWhatsAppQaDriverSession(params) {
|
|
|
312
303
|
};
|
|
313
304
|
}
|
|
314
305
|
//#endregion
|
|
315
|
-
export { DEFAULT_WEB_MEDIA_BYTES, DEFAULT_WHATSAPP_MEDIA_MAX_MB, WHATSAPP_LEGACY_OUTBOUND_SEND_DEP_KEYS, assertWebChannel, hasAnyWhatsAppAuth, isSelfChatMode, isWhatsAppGroupJid, isWhatsAppUserTarget, jidToE164, listEnabledWhatsAppAccounts, listAccountIds as listWhatsAppAccountIds, listWhatsAppAuthDirs, listWhatsAppDirectoryGroupsFromConfig, listWhatsAppDirectoryPeersFromConfig, looksLikeWhatsAppTargetId, markdownToWhatsApp, normalizeE164, normalizeWhatsAppAllowFromEntries, normalizeWhatsAppMessagingTarget, normalizeWhatsAppTarget, resolveDefaultWhatsAppAccountId, resolveJidToE164, resolveUserPath, resolveWhatsAppAccount, resolveWhatsAppAuthDir,
|
|
306
|
+
export { DEFAULT_WEB_MEDIA_BYTES, DEFAULT_WHATSAPP_MEDIA_MAX_MB, WHATSAPP_LEGACY_OUTBOUND_SEND_DEP_KEYS, assertWebChannel, hasAnyWhatsAppAuth, isSelfChatMode, isWhatsAppGroupJid, isWhatsAppUserTarget, jidToE164, listEnabledWhatsAppAccounts, listAccountIds as listWhatsAppAccountIds, listWhatsAppAuthDirs, listWhatsAppDirectoryGroupsFromConfig, listWhatsAppDirectoryPeersFromConfig, looksLikeWhatsAppTargetId, markdownToWhatsApp, normalizeE164, normalizeWhatsAppAllowFromEntries, normalizeWhatsAppMessagingTarget, normalizeWhatsAppTarget, resolveDefaultWhatsAppAccountId, resolveJidToE164, resolveUserPath, resolveWhatsAppAccount, resolveWhatsAppAuthDir, resolveWhatsAppGroupRequireMention, resolveWhatsAppGroupToolPolicy, resolveWhatsAppMediaMaxBytes, resolveWhatsAppOutboundTarget, startWhatsAppQaDriverSession, toWhatsappJid, toWhatsappJidWithLid, testing as whatsappAccessControlTesting, whatsappCommandPolicy, whatsappPlugin, whatsappSetupPlugin };
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import "./accounts-
|
|
1
|
+
import "./accounts-CSqLvCY5.js";
|
|
2
2
|
import { r as resolveDefaultWhatsAppAccountId } from "./account-ids-CB5SOWjc.js";
|
|
3
|
-
import { s as normalizeWhatsAppMessagingTarget } from "./normalize-target-
|
|
4
|
-
import { i as sendTypingWhatsApp, t as sendMessageWhatsApp } from "./send-
|
|
5
|
-
import {
|
|
6
|
-
import "./normalize-
|
|
7
|
-
import { i as unregisterWhatsAppApprovalReactionTarget, r as registerWhatsAppApprovalReactionTarget } from "./approval-reactions-
|
|
3
|
+
import { s as normalizeWhatsAppMessagingTarget } from "./normalize-target-CugRyONv.js";
|
|
4
|
+
import { i as sendTypingWhatsApp, t as sendMessageWhatsApp } from "./send-BTXJAyK4.js";
|
|
5
|
+
import { i as getWhatsAppRuntime } from "./runtime-BLlToOi6.js";
|
|
6
|
+
import "./normalize-C7Hkc_vE.js";
|
|
7
|
+
import { i as unregisterWhatsAppApprovalReactionTarget, r as registerWhatsAppApprovalReactionTarget } from "./approval-reactions-Cu66aYdq.js";
|
|
8
8
|
import { createSubsystemLogger } from "openclaw/plugin-sdk/runtime-env";
|
|
9
9
|
import { DEFAULT_ACCOUNT_ID } from "openclaw/plugin-sdk/account-id";
|
|
10
10
|
import { buildChannelApprovalNativeTargetKey } from "openclaw/plugin-sdk/approval-native-runtime";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { t as __exportAll } from "./rolldown-runtime-D7D4PA-g.js";
|
|
2
|
-
import { a as resolveWhatsAppAccount } from "./accounts-
|
|
3
|
-
import {
|
|
4
|
-
import { c as getWhatsAppApprovalApprovers, l as whatsappApprovalAuth } from "./group-session-key-
|
|
2
|
+
import { a as resolveWhatsAppAccount } from "./accounts-CSqLvCY5.js";
|
|
3
|
+
import { n as getOptionalWhatsAppRuntime } from "./runtime-BLlToOi6.js";
|
|
4
|
+
import { c as getWhatsAppApprovalApprovers, l as whatsappApprovalAuth } from "./group-session-key-DVMZlO3x.js";
|
|
5
5
|
import { createLazyRuntimeModule } from "openclaw/plugin-sdk/lazy-runtime";
|
|
6
6
|
import { createApprovalReactionTargetStore, listApprovalReactionBindings, resolveTypedApprovalReactionTarget } from "openclaw/plugin-sdk/approval-reaction-runtime";
|
|
7
7
|
//#region extensions/whatsapp/src/approval-reactions.ts
|
|
@@ -113,7 +113,7 @@ function readTypedApprovalDeliveryBinding(params) {
|
|
|
113
113
|
return metadata;
|
|
114
114
|
}
|
|
115
115
|
function visibleApprovalBindingMatches(text, binding) {
|
|
116
|
-
const lines = (text ?? "").split(/\r?\n/);
|
|
116
|
+
const lines = (text ?? "").split(/\r?\n/).map((line) => line.replace(/\*\*/g, ""));
|
|
117
117
|
const kindMatches = lines.map((line) => line.match(APPROVAL_KIND_LINE_RE)).filter((match) => Boolean(match));
|
|
118
118
|
const idMatches = lines.map((line) => line.match(APPROVAL_ID_LINE_RE)).filter((match) => Boolean(match));
|
|
119
119
|
const visibleKind = kindMatches[0]?.[1]?.toLowerCase();
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { t as __exportAll } from "./rolldown-runtime-D7D4PA-g.js";
|
|
2
|
-
import { a as readWebCredsJsonRawSync, c as statWebCredsFileSync, i as readWebCredsJsonRaw, o as resolveWebCredsBackupPath, s as resolveWebCredsPath, t as assertWebCredsPathRegularFileOrMissing } from "./creds-files-B1kSWtBg.js";
|
|
3
|
-
import {
|
|
4
|
-
import { c as resolveComparableIdentity } from "./identity-
|
|
2
|
+
import { a as readWebCredsJsonRawSync, c as statWebCredsFileSync, i as readWebCredsJsonRaw, o as resolveWebCredsBackupPath, r as hasWebCredsSync, s as resolveWebCredsPath, t as assertWebCredsPathRegularFileOrMissing } from "./creds-files-B1kSWtBg.js";
|
|
3
|
+
import { n as resolveUserPath } from "./text-runtime-CaKLhowd.js";
|
|
4
|
+
import { c as resolveComparableIdentity } from "./identity-CPrT5aEU.js";
|
|
5
5
|
import path from "node:path";
|
|
6
6
|
import { resolveOAuthDir as resolveOAuthDir$1 } from "openclaw/plugin-sdk/state-paths";
|
|
7
7
|
import { replaceFileAtomic } from "openclaw/plugin-sdk/security-runtime";
|
|
@@ -75,6 +75,7 @@ var auth_store_exports = /* @__PURE__ */ __exportAll({
|
|
|
75
75
|
WhatsAppAuthUnstableError: () => WhatsAppAuthUnstableError,
|
|
76
76
|
formatWhatsAppWebAuthStatusState: () => formatWhatsAppWebAuthStatusState,
|
|
77
77
|
getWebAuthAgeMs: () => getWebAuthAgeMs,
|
|
78
|
+
hasWebCredsSync: () => hasWebCredsSync,
|
|
78
79
|
logWebSelfId: () => logWebSelfId,
|
|
79
80
|
logoutWeb: () => logoutWeb,
|
|
80
81
|
pickWebChannel: () => pickWebChannel,
|
package/dist/call-tool-api.js
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import { a as resolveWhatsAppAccount } from "./accounts-
|
|
2
|
-
import { r as getWhatsAppConnectionController } from "./connection-controller-runtime-context-
|
|
3
|
-
import {
|
|
1
|
+
import { a as resolveWhatsAppAccount } from "./accounts-CSqLvCY5.js";
|
|
2
|
+
import { r as getWhatsAppConnectionController } from "./connection-controller-runtime-context-DG0tuYuw.js";
|
|
3
|
+
import { s as resolveJidToE164 } from "./targets-runtime-TMk0lGuy.js";
|
|
4
4
|
import { createActionGate, stringEnum } from "openclaw/plugin-sdk/channel-actions";
|
|
5
5
|
import path from "node:path";
|
|
6
6
|
import { resolveOAuthDir } from "openclaw/plugin-sdk/state-paths";
|
|
7
7
|
import { normalizeE164 } from "openclaw/plugin-sdk/account-resolution";
|
|
8
|
-
import { resolvePreferredOpenClawTmpDir } from "openclaw/plugin-sdk/temp-path";
|
|
9
8
|
import { normalizeAccountId } from "openclaw/plugin-sdk/account-id";
|
|
10
9
|
import { Type } from "typebox";
|
|
11
10
|
import fs from "node:fs/promises";
|
|
12
11
|
import { mulawToPcm } from "openclaw/plugin-sdk/realtime-voice";
|
|
13
12
|
import { detectBinary } from "openclaw/plugin-sdk/setup-tools";
|
|
13
|
+
import { resolvePreferredOpenClawTmpDir } from "openclaw/plugin-sdk/temp-path";
|
|
14
14
|
import { jsonResult as jsonResult$1 } from "openclaw/plugin-sdk/tool-results";
|
|
15
15
|
//#region extensions/whatsapp/src/agent-tools-call.ts
|
|
16
16
|
const MEOWCALLER_COMMAND = "meowcaller";
|
|
@@ -1,24 +1,25 @@
|
|
|
1
|
-
import { a as resolveWhatsAppAccount } from "./accounts-
|
|
1
|
+
import { a as resolveWhatsAppAccount } from "./accounts-CSqLvCY5.js";
|
|
2
2
|
import { r as resolveDefaultWhatsAppAccountId, t as listAccountIds } from "./account-ids-CB5SOWjc.js";
|
|
3
|
-
import { c as normalizeWhatsAppTarget, i as looksLikeWhatsAppTargetId, n as isWhatsAppNewsletterJid, o as normalizeWhatsAppAllowFromEntry, s as normalizeWhatsAppMessagingTarget, t as isWhatsAppGroupJid } from "./normalize-target-
|
|
4
|
-
import { t as resolveWhatsAppOutboundTarget } from "./resolve-outbound-target-
|
|
5
|
-
import { a as normalizeWhatsAppOutboundPayload, i as sendTypingWhatsApp, n as sendPollWhatsApp, o as normalizeWhatsAppPayloadText, s as normalizeWhatsAppPayloadTextPreservingIndentation, t as sendMessageWhatsApp, u as resolveWhatsAppReactionLevel } from "./send-
|
|
6
|
-
import {
|
|
7
|
-
import "./normalize-
|
|
8
|
-
import {
|
|
9
|
-
import "./text-runtime-
|
|
3
|
+
import { c as normalizeWhatsAppTarget, i as looksLikeWhatsAppTargetId, n as isWhatsAppNewsletterJid, o as normalizeWhatsAppAllowFromEntry, s as normalizeWhatsAppMessagingTarget, t as isWhatsAppGroupJid } from "./normalize-target-CugRyONv.js";
|
|
4
|
+
import { t as resolveWhatsAppOutboundTarget } from "./resolve-outbound-target-1GqbT1uX.js";
|
|
5
|
+
import { a as normalizeWhatsAppOutboundPayload, i as sendTypingWhatsApp, n as sendPollWhatsApp, o as normalizeWhatsAppPayloadText, s as normalizeWhatsAppPayloadTextPreservingIndentation, t as sendMessageWhatsApp, u as resolveWhatsAppReactionLevel } from "./send-BTXJAyK4.js";
|
|
6
|
+
import { i as getWhatsAppRuntime } from "./runtime-BLlToOi6.js";
|
|
7
|
+
import "./normalize-C7Hkc_vE.js";
|
|
8
|
+
import { c as toWhatsappJid } from "./targets-runtime-TMk0lGuy.js";
|
|
9
|
+
import "./text-runtime-CaKLhowd.js";
|
|
10
10
|
import { t as createWhatsAppLoginTool } from "./agent-tools-login-DfyToBpG.js";
|
|
11
|
-
import { c as getWhatsAppApprovalApprovers, l as whatsappApprovalAuth, s as lookupInboundMessageMetaForTarget, t as resolveWhatsAppGroupSessionKey } from "./group-session-key-
|
|
11
|
+
import { c as getWhatsAppApprovalApprovers, l as whatsappApprovalAuth, s as lookupInboundMessageMetaForTarget, t as resolveWhatsAppGroupSessionKey } from "./group-session-key-DVMZlO3x.js";
|
|
12
|
+
import { a as resolveWhatsAppGroupRequireMention, c as isWhatsAppAuthConfigured, i as whatsappSetupContract, l as loadWhatsAppChannelRuntime, n as whatsappSetupWizardProxy, o as resolveWhatsAppGroupToolPolicy, r as whatsappSetupAdapter, s as formatWhatsAppConfigAllowFromEntries, t as createWhatsAppPluginBase } from "./shared-UcAwtJaq.js";
|
|
12
13
|
import { t as whatsappCommandPolicy } from "./command-policy-BIOSHySD.js";
|
|
13
|
-
import {
|
|
14
|
-
import { f as readWebAuthExistsForDecision, n as WHATSAPP_AUTH_UNSTABLE_CODE } from "./auth-store-BQi9pZqQ.js";
|
|
14
|
+
import { f as readWebAuthExistsForDecision, n as WHATSAPP_AUTH_UNSTABLE_CODE } from "./auth-store-DcEpIOmE.js";
|
|
15
15
|
import { t as detectWhatsAppLegacyStateMigrations } from "./state-migrations-CAMTrs2U.js";
|
|
16
16
|
import { createActionGate as createActionGate$1 } from "openclaw/plugin-sdk/channel-actions";
|
|
17
17
|
import { normalizeOptionalAccountId } from "openclaw/plugin-sdk/account-core";
|
|
18
|
-
import {
|
|
18
|
+
import { normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
19
19
|
import { asString, collectIssuesForEnabledAccounts, createAsyncComputedAccountStatusAdapter, createDefaultChannelRuntimeState, isRecord as isRecord$1, readAccountStatusSnapshot } from "openclaw/plugin-sdk/status-helpers";
|
|
20
20
|
import { formatCliCommand } from "openclaw/plugin-sdk/cli-runtime";
|
|
21
21
|
import { buildChannelOutboundSessionRoute } from "openclaw/plugin-sdk/core";
|
|
22
|
+
import { chunkText } from "openclaw/plugin-sdk/reply-chunking";
|
|
22
23
|
import { createMessageReceiptFromOutboundResults, defineChannelMessageAdapter, resolveOutboundSendDep } from "openclaw/plugin-sdk/channel-outbound";
|
|
23
24
|
import { sendTextMediaPayload } from "openclaw/plugin-sdk/reply-payload";
|
|
24
25
|
import { DEFAULT_ACCOUNT_ID as DEFAULT_ACCOUNT_ID$1 } from "openclaw/plugin-sdk/account-id";
|
|
@@ -27,46 +28,23 @@ import { createChatChannelPlugin } from "openclaw/plugin-sdk/channel-core";
|
|
|
27
28
|
import { createLazyRuntimeModule } from "openclaw/plugin-sdk/lazy-runtime";
|
|
28
29
|
import { createChannelApprovalCapability } from "openclaw/plugin-sdk/approval-delivery-runtime";
|
|
29
30
|
import { createLazyChannelApprovalNativeRuntimeAdapter } from "openclaw/plugin-sdk/approval-handler-adapter-runtime";
|
|
30
|
-
import { createChannelApproverDmTargetResolver, createChannelNativeOriginTargetResolver, createNativeApprovalChannelRouteGates, createNativeApprovalForwardingFallbackSuppressor } from "openclaw/plugin-sdk/approval-native-runtime";
|
|
31
|
+
import { createChannelApproverDmTargetResolver, createChannelNativeOriginTargetResolver, createNativeApprovalChannelRouteGates, createNativeApprovalForwardingFallbackSuppressor, createNativeApprovalMessagingTargetResolvers } from "openclaw/plugin-sdk/approval-native-runtime";
|
|
31
32
|
import { buildApprovalReactionPromptPayloadForRequest } from "openclaw/plugin-sdk/approval-reaction-runtime";
|
|
32
33
|
import { buildTypedApprovalPresentation } from "openclaw/plugin-sdk/approval-reply-runtime";
|
|
33
34
|
import { questionGatewayRuntime } from "openclaw/plugin-sdk/question-gateway-runtime";
|
|
34
|
-
import { chunkText } from "openclaw/plugin-sdk/reply-chunking";
|
|
35
35
|
import { attachChannelToResult, createAttachedChannelResultAdapter } from "openclaw/plugin-sdk/channel-send-result";
|
|
36
36
|
//#region extensions/whatsapp/src/approval-native.ts
|
|
37
37
|
const DEFAULT_APPROVAL_FORWARDING_MODE = "session";
|
|
38
|
+
const { normalizeForwardTarget: normalizeWhatsAppForwardTarget, normalizeTarget: normalizeWhatsAppApprovalTarget, resolveSessionTarget: resolveSessionWhatsAppOriginTarget, resolveTurnSourceTarget: resolveTurnSourceWhatsAppOriginTarget } = createNativeApprovalMessagingTargetResolvers({
|
|
39
|
+
channel: "whatsapp",
|
|
40
|
+
normalizeTo: normalizeWhatsAppMessagingTarget
|
|
41
|
+
});
|
|
38
42
|
function isWhatsAppApprovalTransportEnabled(params) {
|
|
39
43
|
return resolveWhatsAppAccount({
|
|
40
44
|
cfg: params.cfg,
|
|
41
45
|
accountId: params.accountId
|
|
42
46
|
}).enabled;
|
|
43
47
|
}
|
|
44
|
-
function normalizeWhatsAppForwardTarget(target) {
|
|
45
|
-
if (normalizeLowercaseStringOrEmpty(target.channel) !== "whatsapp") return null;
|
|
46
|
-
const to = normalizeWhatsAppMessagingTarget(target.to);
|
|
47
|
-
if (!to) return null;
|
|
48
|
-
return {
|
|
49
|
-
to,
|
|
50
|
-
accountId: normalizeOptionalString(target.accountId),
|
|
51
|
-
threadId: target.threadId ?? null
|
|
52
|
-
};
|
|
53
|
-
}
|
|
54
|
-
function resolveTurnSourceWhatsAppOriginTarget(request) {
|
|
55
|
-
if (normalizeLowercaseStringOrEmpty(request.request.turnSourceChannel) !== "whatsapp") return null;
|
|
56
|
-
const to = normalizeWhatsAppMessagingTarget(request.request.turnSourceTo ?? "");
|
|
57
|
-
if (!to) return null;
|
|
58
|
-
return {
|
|
59
|
-
to,
|
|
60
|
-
accountId: normalizeOptionalString(request.request.turnSourceAccountId)
|
|
61
|
-
};
|
|
62
|
-
}
|
|
63
|
-
function resolveSessionWhatsAppOriginTarget(sessionTarget) {
|
|
64
|
-
const to = normalizeWhatsAppMessagingTarget(sessionTarget.to);
|
|
65
|
-
return to ? {
|
|
66
|
-
to,
|
|
67
|
-
accountId: normalizeOptionalString(sessionTarget.accountId)
|
|
68
|
-
} : null;
|
|
69
|
-
}
|
|
70
48
|
const { canApprovalPotentiallyRouteToChannel: canApprovalPotentiallyRouteToWhatsApp, canAnyApprovalPotentiallyRouteToChannel: canAnyApprovalPotentiallyRouteToWhatsApp, isSessionApprovalEligible: isWhatsAppSessionApprovalEligible, isExplicitTargetEligible: isWhatsAppExplicitTargetEligible, shouldHandleApprovalRequest: shouldHandleWhatsAppApprovalRequest } = createNativeApprovalChannelRouteGates({
|
|
71
49
|
channel: "whatsapp",
|
|
72
50
|
defaultForwardingMode: DEFAULT_APPROVAL_FORWARDING_MODE,
|
|
@@ -81,13 +59,7 @@ const resolveWhatsAppOriginTargetBase = createChannelNativeOriginTargetResolver(
|
|
|
81
59
|
shouldHandleRequest: shouldHandleWhatsAppApprovalRequest,
|
|
82
60
|
resolveTurnSourceTarget: resolveTurnSourceWhatsAppOriginTarget,
|
|
83
61
|
resolveSessionTarget: resolveSessionWhatsAppOriginTarget,
|
|
84
|
-
normalizeTarget:
|
|
85
|
-
const to = normalizeWhatsAppMessagingTarget(target.to);
|
|
86
|
-
return to ? {
|
|
87
|
-
...target,
|
|
88
|
-
to
|
|
89
|
-
} : null;
|
|
90
|
-
}
|
|
62
|
+
normalizeTarget: normalizeWhatsAppApprovalTarget
|
|
91
63
|
});
|
|
92
64
|
function resolveWhatsAppOriginTarget(params) {
|
|
93
65
|
const target = resolveWhatsAppOriginTargetBase(params);
|
|
@@ -225,7 +197,7 @@ const whatsappApprovalCapability = createChannelApprovalCapability({
|
|
|
225
197
|
approvalKind,
|
|
226
198
|
request
|
|
227
199
|
}),
|
|
228
|
-
load: async () => (await import("./approval-handler.runtime-
|
|
200
|
+
load: async () => (await import("./approval-handler.runtime-CmtqgLSQ.js")).whatsappApprovalNativeRuntime
|
|
229
201
|
})
|
|
230
202
|
});
|
|
231
203
|
//#endregion
|
|
@@ -294,7 +266,8 @@ function createWhatsAppOutboundBase({ chunker, sendMessageWhatsApp, sendPollWhat
|
|
|
294
266
|
remoteJid: cachedMeta?.remoteJid ?? targetJid,
|
|
295
267
|
fromMe: cachedMeta?.fromMe ?? false,
|
|
296
268
|
participant: cachedMeta?.participant,
|
|
297
|
-
messageText: cachedMeta?.body
|
|
269
|
+
messageText: cachedMeta?.body,
|
|
270
|
+
media: cachedMeta?.media
|
|
298
271
|
};
|
|
299
272
|
};
|
|
300
273
|
const outbound = {
|
|
@@ -391,8 +364,8 @@ function createWhatsAppOutboundBase({ chunker, sendMessageWhatsApp, sendPollWhat
|
|
|
391
364
|
}
|
|
392
365
|
//#endregion
|
|
393
366
|
//#region extensions/whatsapp/src/channel-outbound.ts
|
|
394
|
-
const loadWhatsAppApprovalReactionsModule = createLazyRuntimeModule(() => import("./approval-reactions-
|
|
395
|
-
const loadWhatsAppQuestionReactionsModule = createLazyRuntimeModule(() => import("./question-reactions-
|
|
367
|
+
const loadWhatsAppApprovalReactionsModule = createLazyRuntimeModule(() => import("./approval-reactions-Cu66aYdq.js").then((n) => n.t));
|
|
368
|
+
const loadWhatsAppQuestionReactionsModule = createLazyRuntimeModule(() => import("./question-reactions-CRsnyoMK.js").then((n) => n.n));
|
|
396
369
|
function normalizeWhatsAppChannelPayloadText(text) {
|
|
397
370
|
return normalizeWhatsAppPayloadTextPreservingIndentation(text);
|
|
398
371
|
}
|
|
@@ -473,15 +446,6 @@ const whatsappMessageAdapter = defineChannelMessageAdapter({
|
|
|
473
446
|
});
|
|
474
447
|
//#endregion
|
|
475
448
|
//#region extensions/whatsapp/src/group-intro.ts
|
|
476
|
-
const WHATSAPP_GROUP_INTRO_HINT = "WhatsApp IDs: SenderId is the participant JID (group participant id).";
|
|
477
|
-
/**
|
|
478
|
-
* @deprecated Core never consumed the group intro hint adapter; this export
|
|
479
|
-
* remains only for the plugin API surface and is removed after the next
|
|
480
|
-
* release train together with ChannelGroupAdapter.resolveGroupIntroHint.
|
|
481
|
-
*/
|
|
482
|
-
function resolveWhatsAppGroupIntroHint() {
|
|
483
|
-
return WHATSAPP_GROUP_INTRO_HINT;
|
|
484
|
-
}
|
|
485
449
|
function resolveWhatsAppMentionStripRegexes(ctx) {
|
|
486
450
|
const selfE164 = (ctx.To ?? "").replace(/^whatsapp:/i, "");
|
|
487
451
|
if (!selfE164) return [];
|
|
@@ -491,7 +455,7 @@ function resolveWhatsAppMentionStripRegexes(ctx) {
|
|
|
491
455
|
//#endregion
|
|
492
456
|
//#region extensions/whatsapp/src/heartbeat.ts
|
|
493
457
|
async function checkWhatsAppHeartbeatReady(params) {
|
|
494
|
-
if (params.cfg.
|
|
458
|
+
if (params.cfg.channels?.whatsapp?.enabled === false) return {
|
|
495
459
|
ok: false,
|
|
496
460
|
reason: "whatsapp-disabled"
|
|
497
461
|
};
|
|
@@ -665,8 +629,8 @@ function collectWhatsAppStatusIssues(accounts) {
|
|
|
665
629
|
}
|
|
666
630
|
//#endregion
|
|
667
631
|
//#region extensions/whatsapp/src/channel.ts
|
|
668
|
-
const loadWhatsAppDirectoryConfig = createLazyRuntimeModule(() => import("./directory-config-
|
|
669
|
-
const loadWhatsAppChannelReactAction = createLazyRuntimeModule(() => import("./channel-react-action-
|
|
632
|
+
const loadWhatsAppDirectoryConfig = createLazyRuntimeModule(() => import("./directory-config-DalGrfGN.js").then((n) => n.t));
|
|
633
|
+
const loadWhatsAppChannelReactAction = createLazyRuntimeModule(() => import("./channel-react-action-DUIkjl6w.js"));
|
|
670
634
|
function resolveWhatsAppTargetInfo(raw) {
|
|
671
635
|
const normalized = normalizeWhatsAppTarget(raw);
|
|
672
636
|
if (!normalized) return null;
|
|
@@ -675,6 +639,10 @@ function resolveWhatsAppTargetInfo(raw) {
|
|
|
675
639
|
chatType: isWhatsAppGroupJid(normalized) ? "group" : isWhatsAppNewsletterJid(normalized) ? "channel" : "direct"
|
|
676
640
|
};
|
|
677
641
|
}
|
|
642
|
+
function resolveWhatsAppMessageActionTarget(params) {
|
|
643
|
+
const chatJid = params.args.chatJid;
|
|
644
|
+
return typeof chatJid === "string" ? normalizeWhatsAppMessagingTarget(chatJid) : void 0;
|
|
645
|
+
}
|
|
678
646
|
const whatsappPlugin = createChatChannelPlugin({
|
|
679
647
|
pairing: {
|
|
680
648
|
idLabel: "whatsappSenderId",
|
|
@@ -696,9 +664,8 @@ const whatsappPlugin = createChatChannelPlugin({
|
|
|
696
664
|
},
|
|
697
665
|
setupWizard: whatsappSetupWizardProxy,
|
|
698
666
|
setup: whatsappSetupAdapter,
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
}
|
|
667
|
+
setupContract: whatsappSetupContract,
|
|
668
|
+
isConfigured: async (account) => await isWhatsAppAuthConfigured(account.authDir)
|
|
702
669
|
}),
|
|
703
670
|
agentTools: () => [createWhatsAppLoginTool()],
|
|
704
671
|
allowlist: buildDmGroupAccountAllowlistAdapter({
|
|
@@ -770,6 +737,11 @@ const whatsappPlugin = createChatChannelPlugin({
|
|
|
770
737
|
listGroupsLive: async (params) => (await loadWhatsAppDirectoryConfig()).listWhatsAppDirectoryGroupsLive(params)
|
|
771
738
|
},
|
|
772
739
|
actions: {
|
|
740
|
+
messageActionTargetAliases: { react: {
|
|
741
|
+
aliases: ["chatJid", "messageId"],
|
|
742
|
+
deliveryTargetAliases: ["chatJid"],
|
|
743
|
+
resolveDeliveryTarget: resolveWhatsAppMessageActionTarget
|
|
744
|
+
} },
|
|
773
745
|
describeMessageTool: ({ cfg, accountId }) => describeWhatsAppMessageActions({
|
|
774
746
|
cfg,
|
|
775
747
|
accountId
|
|
@@ -936,4 +908,4 @@ const whatsappPlugin = createChatChannelPlugin({
|
|
|
936
908
|
}
|
|
937
909
|
});
|
|
938
910
|
//#endregion
|
|
939
|
-
export {
|
|
911
|
+
export { WHATSAPP_LEGACY_OUTBOUND_SEND_DEP_KEYS as n, whatsappPlugin as t };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as WhatsAppChannelConfigSchema } from "./config-schema-
|
|
1
|
+
import { t as WhatsAppChannelConfigSchema } from "./config-schema-DARep0Nn.js";
|
|
2
2
|
export { WhatsAppChannelConfigSchema };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as whatsappPlugin } from "./channel-
|
|
1
|
+
import { t as whatsappPlugin } from "./channel-DcWBc3Hb.js";
|
|
2
2
|
export { whatsappPlugin };
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import { a as resolveWhatsAppAccount, s as resolveWhatsAppMediaMaxBytes } from "./accounts-
|
|
2
|
-
import { c as normalizeWhatsAppTarget, t as isWhatsAppGroupJid } from "./normalize-target-
|
|
3
|
-
import { r as resolveAuthorizedWhatsAppOutboundTarget, t as handleWhatsAppAction } from "./action-runtime-
|
|
4
|
-
import { t as sendMessageWhatsApp } from "./send-
|
|
5
|
-
import "./normalize-
|
|
1
|
+
import { a as resolveWhatsAppAccount, s as resolveWhatsAppMediaMaxBytes } from "./accounts-CSqLvCY5.js";
|
|
2
|
+
import { c as normalizeWhatsAppTarget, t as isWhatsAppGroupJid } from "./normalize-target-CugRyONv.js";
|
|
3
|
+
import { r as resolveAuthorizedWhatsAppOutboundTarget, t as handleWhatsAppAction } from "./action-runtime-B2bNDUwE.js";
|
|
4
|
+
import { t as sendMessageWhatsApp } from "./send-BTXJAyK4.js";
|
|
5
|
+
import "./normalize-C7Hkc_vE.js";
|
|
6
6
|
import { jsonResult, readStringOrNumberParam, readStringParam as readStringParam$1, resolveReactionMessageId } from "openclaw/plugin-sdk/channel-actions";
|
|
7
|
+
import { canonicalizeBase64, estimateBase64DecodedBytes } from "openclaw/plugin-sdk/media-runtime";
|
|
7
8
|
import { readBooleanParam } from "openclaw/plugin-sdk/boolean-param";
|
|
8
9
|
//#region extensions/whatsapp/src/channel-react-action.ts
|
|
9
10
|
const WHATSAPP_CHANNEL = "whatsapp";
|
|
@@ -23,23 +24,19 @@ function readWhatsAppActionChatJid(params) {
|
|
|
23
24
|
return normalizeWhatsAppTarget(params.toolContext.currentChannelId) ?? void 0;
|
|
24
25
|
}
|
|
25
26
|
function extractBase64Payload(encoded) {
|
|
26
|
-
|
|
27
|
-
return payload !== void 0 ? payload : encoded;
|
|
28
|
-
}
|
|
29
|
-
function estimateBase64DecodedBytes(encoded) {
|
|
30
|
-
const compact = extractBase64Payload(encoded).replace(/\s/g, "");
|
|
31
|
-
if (!compact) return 0;
|
|
32
|
-
const padding = compact.endsWith("==") ? 2 : compact.endsWith("=") ? 1 : 0;
|
|
33
|
-
return Math.max(0, Math.floor(compact.length * 3 / 4) - padding);
|
|
27
|
+
return /^data:[^;]+;base64,(.*)$/is.exec(encoded.trim())?.[1] ?? encoded;
|
|
34
28
|
}
|
|
35
29
|
function decodeUploadFileMediaPayload(params) {
|
|
30
|
+
const payload = extractBase64Payload(params.encoded);
|
|
36
31
|
if (params.maxBytes !== void 0) {
|
|
37
|
-
const estimatedBytes = estimateBase64DecodedBytes(
|
|
32
|
+
const estimatedBytes = estimateBase64DecodedBytes(payload);
|
|
38
33
|
if (estimatedBytes > params.maxBytes) throw new Error(`WhatsApp upload-file buffer exceeds configured media limit (${estimatedBytes} bytes > ${params.maxBytes} bytes).`);
|
|
39
34
|
}
|
|
40
35
|
const contentType = readStringParam$1(params.args, "contentType") ?? readStringParam$1(params.args, "mimeType");
|
|
41
36
|
const fileName = readStringParam$1(params.args, "filename") ?? readStringParam$1(params.args, "fileName");
|
|
42
|
-
const
|
|
37
|
+
const canonicalPayload = canonicalizeBase64(payload);
|
|
38
|
+
if (!canonicalPayload) throw new Error("WhatsApp upload-file buffer must be valid base64 or a base64 data URL.");
|
|
39
|
+
const buffer = Buffer.from(canonicalPayload, "base64");
|
|
43
40
|
if (params.maxBytes !== void 0 && buffer.byteLength > params.maxBytes) throw new Error(`WhatsApp upload-file buffer exceeds configured media limit (${buffer.byteLength} bytes > ${params.maxBytes} bytes).`);
|
|
44
41
|
return {
|
|
45
42
|
buffer,
|
|
@@ -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-
|
|
3
|
-
import { t as getActiveWebListener$1 } from "./active-listener-
|
|
4
|
-
import { t as monitorWebChannel$1 } from "./monitor-
|
|
5
|
-
import { t as loginWeb$1 } from "./login-
|
|
6
|
-
import { whatsappSetupWizard as whatsappSetupWizard$1 } from "./setup-surface-
|
|
2
|
+
import { 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-DcEpIOmE.js";
|
|
3
|
+
import { t as getActiveWebListener$1 } from "./active-listener-BEjWsCNM.js";
|
|
4
|
+
import { t as monitorWebChannel$1 } from "./monitor-B7phZF9w.js";
|
|
5
|
+
import { t as loginWeb$1 } from "./login-CvY2Dhch.js";
|
|
6
|
+
import { whatsappSetupWizard as whatsappSetupWizard$1 } from "./setup-surface-BjvUbR6M.js";
|
|
7
7
|
//#region extensions/whatsapp/src/channel.runtime.ts
|
|
8
8
|
function getActiveWebListener(...args) {
|
|
9
9
|
return getActiveWebListener$1(...args);
|
|
@@ -1,10 +1,6 @@
|
|
|
1
|
-
import { a as resolveWhatsAppGroupRequireMention, i as
|
|
1
|
+
import { a as resolveWhatsAppGroupRequireMention, c as isWhatsAppAuthConfigured, i as whatsappSetupContract, n as whatsappSetupWizardProxy, o as resolveWhatsAppGroupToolPolicy, r as whatsappSetupAdapter, t as createWhatsAppPluginBase } from "./shared-UcAwtJaq.js";
|
|
2
2
|
import { t as detectWhatsAppLegacyStateMigrations } from "./state-migrations-CAMTrs2U.js";
|
|
3
3
|
//#region extensions/whatsapp/src/channel.setup.ts
|
|
4
|
-
async function isWhatsAppAuthConfigured(account) {
|
|
5
|
-
const { readWebAuthState } = await import("./auth-store-BQi9pZqQ.js").then((n) => n.i);
|
|
6
|
-
return await readWebAuthState(account.authDir) === "linked";
|
|
7
|
-
}
|
|
8
4
|
const whatsappSetupPlugin = {
|
|
9
5
|
...createWhatsAppPluginBase({
|
|
10
6
|
groups: {
|
|
@@ -13,7 +9,8 @@ const whatsappSetupPlugin = {
|
|
|
13
9
|
},
|
|
14
10
|
setupWizard: whatsappSetupWizardProxy,
|
|
15
11
|
setup: whatsappSetupAdapter,
|
|
16
|
-
|
|
12
|
+
setupContract: whatsappSetupContract,
|
|
13
|
+
isConfigured: async (account) => await isWhatsAppAuthConfigured(account.authDir)
|
|
17
14
|
}),
|
|
18
15
|
lifecycle: { detectLegacyStateMigrations: ({ oauthDir }) => detectWhatsAppLegacyStateMigrations({ oauthDir }) }
|
|
19
16
|
};
|
|
@@ -6,20 +6,22 @@ import { WhatsAppConfigSchema } from "openclaw/plugin-sdk/bundled-channel-config
|
|
|
6
6
|
const WhatsAppChannelConfigSchema = buildChannelConfigSchema(WhatsAppConfigSchema, { uiHints: {
|
|
7
7
|
"": {
|
|
8
8
|
label: "WhatsApp",
|
|
9
|
-
help: "WhatsApp channel provider configuration for access policy and
|
|
9
|
+
help: "WhatsApp channel provider configuration for access policy and direct-message routing safety."
|
|
10
10
|
},
|
|
11
11
|
...createChannelConfigUiHints({
|
|
12
12
|
channelLabel: "WhatsApp",
|
|
13
13
|
dmPolicy: { channelKey: "whatsapp" }
|
|
14
14
|
}),
|
|
15
|
+
allowFrom: { presentation: "phone-number" },
|
|
16
|
+
defaultTo: { presentation: "phone-number" },
|
|
17
|
+
groupAllowFrom: { presentation: "phone-number" },
|
|
18
|
+
"accounts.*.allowFrom.*": { presentation: "phone-number" },
|
|
19
|
+
"accounts.*.defaultTo": { presentation: "phone-number" },
|
|
20
|
+
"accounts.*.groupAllowFrom.*": { presentation: "phone-number" },
|
|
15
21
|
selfChatMode: {
|
|
16
22
|
label: "WhatsApp Self-Phone Mode",
|
|
17
23
|
help: "Same-phone setup (bot uses your personal WhatsApp number)."
|
|
18
24
|
},
|
|
19
|
-
debounceMs: {
|
|
20
|
-
label: "WhatsApp Message Debounce (ms)",
|
|
21
|
-
help: "Debounce window (ms) for batching rapid consecutive messages from the same sender (0 to disable)."
|
|
22
|
-
},
|
|
23
25
|
...createChannelConfigUiHints({
|
|
24
26
|
channelLabel: "WhatsApp",
|
|
25
27
|
configWrites: true
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { n as WHATSAPP_CONNECTION_OWNER_PENDING_CAPABILITY, t as WHATSAPP_CONNECTION_CONTROLLER_CAPABILITY } from "./connection-controller-runtime-context-
|
|
3
|
-
import { c as logoutWeb, f as readWebAuthExistsForDecision, r as WhatsAppAuthUnstableError, w as waitForCredsSaveQueueWithTimeout } from "./auth-store-
|
|
4
|
-
import { c as resolveComparableIdentity } from "./identity-
|
|
5
|
-
import { a as waitForWaConnection, m as acquireWhatsAppGatewayConnectionOwner, o as DEFAULT_WHATSAPP_SOCKET_TIMING, r as createWaSocket, t as closeWhatsAppSocketAndWait } from "./socket-close-
|
|
1
|
+
import { r as getWhatsAppChannelRuntime } from "./runtime-BLlToOi6.js";
|
|
2
|
+
import { n as WHATSAPP_CONNECTION_OWNER_PENDING_CAPABILITY, t as WHATSAPP_CONNECTION_CONTROLLER_CAPABILITY } from "./connection-controller-runtime-context-DG0tuYuw.js";
|
|
3
|
+
import { c as logoutWeb, f as readWebAuthExistsForDecision, r as WhatsAppAuthUnstableError, w as waitForCredsSaveQueueWithTimeout } from "./auth-store-DcEpIOmE.js";
|
|
4
|
+
import { c as resolveComparableIdentity } from "./identity-CPrT5aEU.js";
|
|
5
|
+
import { a as waitForWaConnection, m as acquireWhatsAppGatewayConnectionOwner, o as DEFAULT_WHATSAPP_SOCKET_TIMING, r as createWaSocket, t as closeWhatsAppSocketAndWait } from "./socket-close-DridEuzz.js";
|
|
6
6
|
import { n as getStatusCode, t as formatError } from "./session-errors-JuazczrA.js";
|
|
7
7
|
import { computeBackoff, info, sleepWithAbort } from "openclaw/plugin-sdk/runtime-env";
|
|
8
8
|
import { registerChannelRuntimeContext } from "openclaw/plugin-sdk/channel-runtime-context";
|
|
@@ -18,16 +18,14 @@ const DEFAULT_RECONNECT_POLICY = {
|
|
|
18
18
|
maxAttempts: 12
|
|
19
19
|
};
|
|
20
20
|
function resolveHeartbeatSeconds(cfg, overrideSeconds) {
|
|
21
|
-
const candidate = overrideSeconds
|
|
21
|
+
const candidate = overrideSeconds;
|
|
22
22
|
if (typeof candidate === "number" && candidate > 0) return candidate;
|
|
23
23
|
return DEFAULT_HEARTBEAT_SECONDS;
|
|
24
24
|
}
|
|
25
25
|
function resolveReconnectPolicy(cfg, overrides) {
|
|
26
|
-
const reconnectOverrides = cfg.web?.reconnect ?? {};
|
|
27
26
|
const overrideConfig = overrides ?? {};
|
|
28
27
|
const merged = {
|
|
29
28
|
...DEFAULT_RECONNECT_POLICY,
|
|
30
|
-
...reconnectOverrides,
|
|
31
29
|
...overrideConfig
|
|
32
30
|
};
|
|
33
31
|
merged.initialMs = Math.max(250, merged.initialMs);
|
|
@@ -401,7 +399,7 @@ var WhatsAppConnectionController = class {
|
|
|
401
399
|
connection.unregisterTransportActivity = this.attachTransportActivityListener(sock);
|
|
402
400
|
const previousRuntimeContextLease = this.runtimeContextLease;
|
|
403
401
|
this.runtimeContextLease = registerChannelRuntimeContext({
|
|
404
|
-
channelRuntime:
|
|
402
|
+
channelRuntime: getWhatsAppChannelRuntime(),
|
|
405
403
|
channelId: "whatsapp",
|
|
406
404
|
accountId: this.accountId,
|
|
407
405
|
capability: WHATSAPP_CONNECTION_CONTROLLER_CAPABILITY,
|
|
@@ -622,7 +620,7 @@ var WhatsAppConnectionController = class {
|
|
|
622
620
|
try {
|
|
623
621
|
if (this.shuttingDown) throw stoppedControllerError();
|
|
624
622
|
this.pendingOwnerContextLease = registerChannelRuntimeContext({
|
|
625
|
-
channelRuntime:
|
|
623
|
+
channelRuntime: getWhatsAppChannelRuntime(),
|
|
626
624
|
channelId: "whatsapp",
|
|
627
625
|
accountId: this.accountId,
|
|
628
626
|
capability: WHATSAPP_CONNECTION_OWNER_PENDING_CAPABILITY,
|