@openclaw/whatsapp 2026.7.2-beta.3 → 2026.7.2-beta.4
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-tjy_em01.js → access-control-CRz_v6bR.js} +4 -5
- package/dist/{accounts-ejK8sXPU.js → accounts-CxPuEFi-.js} +1 -1
- package/dist/{action-runtime-p0V390gA.js → action-runtime-CHU7xb6o.js} +2 -2
- 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 +12 -15
- package/dist/{approval-handler.runtime-BO1oJ-b8.js → approval-handler.runtime-C4ddB7Kc.js} +4 -4
- package/dist/{approval-reactions-CrZFAyf-.js → approval-reactions-P2HXjmln.js} +3 -3
- package/dist/{auth-store-BQi9pZqQ.js → auth-store-DirYMTbo.js} +4 -3
- package/dist/call-tool-api.js +4 -4
- package/dist/{channel-B2I4Opzb.js → channel-B9xjrOGG.js} +28 -19
- 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-CBW-PA8q.js} +10 -13
- package/dist/{channel.runtime-CjkhQzk8.js → channel.runtime-DdKuhlNu.js} +5 -5
- package/dist/{channel.setup-BMWE9LmN.js → channel.setup-DXUCPHel.js} +3 -6
- package/dist/{config-schema-BZ8h1hWA.js → config-schema-C6IeKIC0.js} +6 -0
- package/dist/{connection-controller-HGaffeFb.js → connection-controller-BVRExqrB.js} +8 -10
- package/dist/{connection-controller-runtime-context-9mEeAvu1.js → connection-controller-runtime-context-DG0tuYuw.js} +3 -3
- package/dist/contract-api.js +1 -1
- package/dist/{directory-config-BZ775eGX.js → directory-config-BTbJkV1W.js} +5 -5
- 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-DJSdYfnb.js} +9 -4
- package/dist/{identity-D7L8LCuH.js → identity-BM4_wZeM.js} +2 -2
- package/dist/light-runtime-api.js +2 -2
- package/dist/{login-ifOXCBjo.js → login-BKUm7KSk.js} +6 -7
- package/dist/{login-qr-DUHzVH_Y.js → login-qr-DagJvMbg.js} +7 -8
- package/dist/login-qr-runtime.js +1 -1
- package/dist/{monitor-_jqDKBXj.js → monitor-CBVNJ2lb.js} +206 -232
- package/dist/{question-reactions-C0qJ6wGA.js → question-reactions-CaOrSYzU.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-DhJVN30g.js} +38 -84
- package/dist/{send-api-BG0MgoFI.js → send-api-CpHwbor_.js} +39 -33
- package/dist/{setup-finalize-Cc-4iWGj.js → setup-finalize-9XzKdFq6.js} +3 -3
- package/dist/setup-plugin-api.js +1 -1
- package/dist/{setup-surface-DhnXEZir.js → setup-surface-Kv3mPki2.js} +3 -3
- package/dist/{setup-core-BbIgEl2M.js → shared-CuqHFnKd.js} +78 -56
- package/dist/{socket-close-jNGyZY4T.js → socket-close-BoSHhQNJ.js} +5 -6
- package/dist/{targets-runtime-Bsh0HR9y.js → targets-runtime-CKFrhoX4.js} +142 -29
- package/dist/text-runtime-CU_IlbK5.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/npm-shrinkwrap.json +41 -45
- package/openclaw.plugin.json +139 -179
- package/package.json +21 -11
- package/dist/doctor-By3SB4lm.js +0 -48
- 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
|
@@ -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-CxPuEFi-.js";
|
|
2
|
+
import { n as isSelfChatMode } from "./targets-runtime-CKFrhoX4.js";
|
|
3
|
+
import { t as normalizeE164 } from "./text-runtime-CU_IlbK5.js";
|
|
4
|
+
import { a as getSelfIdentity, o as getSenderIdentity } from "./identity-BM4_wZeM.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,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { a as resolveWhatsAppAccount } from "./accounts-
|
|
1
|
+
import { a as resolveWhatsAppAccount } from "./accounts-CxPuEFi-.js";
|
|
2
2
|
import { t as resolveWhatsAppOutboundTarget } from "./resolve-outbound-target-BR97fAbB.js";
|
|
3
|
-
import { r as sendReactionWhatsApp, u as resolveWhatsAppReactionLevel } from "./send-
|
|
3
|
+
import { r as sendReactionWhatsApp, u as resolveWhatsAppReactionLevel } from "./send-DhJVN30g.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-CHU7xb6o.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-CHU7xb6o.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,26 @@
|
|
|
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-CxPuEFi-.js";
|
|
2
2
|
import { r as resolveDefaultWhatsAppAccountId, t as listAccountIds } from "./account-ids-CB5SOWjc.js";
|
|
3
3
|
import { a as normalizeWhatsAppAllowFromEntries, c as normalizeWhatsAppTarget, i as looksLikeWhatsAppTargetId, r as isWhatsAppUserTarget, s as normalizeWhatsAppMessagingTarget, t as isWhatsAppGroupJid } from "./normalize-target-DSZnHkKF.js";
|
|
4
4
|
import { t as resolveWhatsAppOutboundTarget } from "./resolve-outbound-target-BR97fAbB.js";
|
|
5
|
-
import "./send-
|
|
6
|
-
import { c as
|
|
7
|
-
import { n as
|
|
8
|
-
import { n as resolveWhatsAppGroupIntroHint, r as WHATSAPP_LEGACY_OUTBOUND_SEND_DEP_KEYS, t as whatsappPlugin } from "./channel-
|
|
5
|
+
import "./send-DhJVN30g.js";
|
|
6
|
+
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-CKFrhoX4.js";
|
|
7
|
+
import { n as resolveUserPath, t as normalizeE164 } from "./text-runtime-CU_IlbK5.js";
|
|
8
|
+
import { n as resolveWhatsAppGroupIntroHint, r as WHATSAPP_LEGACY_OUTBOUND_SEND_DEP_KEYS, t as whatsappPlugin } from "./channel-B9xjrOGG.js";
|
|
9
|
+
import { a as resolveWhatsAppGroupRequireMention, o as resolveWhatsAppGroupToolPolicy } from "./shared-CuqHFnKd.js";
|
|
9
10
|
import { t as whatsappCommandPolicy } from "./command-policy-BIOSHySD.js";
|
|
10
|
-
import
|
|
11
|
-
import "./
|
|
12
|
-
import { t as whatsappSetupPlugin } from "./channel.setup-BMWE9LmN.js";
|
|
11
|
+
import "./config-schema-C6IeKIC0.js";
|
|
12
|
+
import { t as whatsappSetupPlugin } from "./channel.setup-DXUCPHel.js";
|
|
13
13
|
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-
|
|
14
|
+
import { a as waitForWaConnection, o as DEFAULT_WHATSAPP_SOCKET_TIMING, r as createWaSocket, s as createWhatsAppSocketOperationTimeoutAdapter } from "./socket-close-BoSHhQNJ.js";
|
|
15
15
|
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 {
|
|
16
|
+
import { n as listWhatsAppDirectoryGroupsFromConfig, r as listWhatsAppDirectoryPeersFromConfig } from "./directory-config-BTbJkV1W.js";
|
|
17
|
+
import { n as testing } from "./access-control-CRz_v6bR.js";
|
|
18
|
+
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-CpHwbor_.js";
|
|
19
19
|
import "openclaw/plugin-sdk/channel-actions";
|
|
20
20
|
import "openclaw/plugin-sdk/account-resolution";
|
|
21
21
|
import "openclaw/plugin-sdk/core";
|
|
22
22
|
import "openclaw/plugin-sdk/account-id";
|
|
23
|
-
import { createLazyRuntimeModule } from "openclaw/plugin-sdk/lazy-runtime";
|
|
24
23
|
import { formatLocationText } from "openclaw/plugin-sdk/channel-inbound";
|
|
25
|
-
createLazyRuntimeModule(() => import("./channel.runtime-CjkhQzk8.js"));
|
|
26
|
-
//#endregion
|
|
27
24
|
//#region extensions/whatsapp/src/qa-driver.runtime.ts
|
|
28
25
|
function isRecord(value) {
|
|
29
26
|
return Boolean(value && typeof value === "object");
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import "./accounts-
|
|
1
|
+
import "./accounts-CxPuEFi-.js";
|
|
2
2
|
import { r as resolveDefaultWhatsAppAccountId } from "./account-ids-CB5SOWjc.js";
|
|
3
3
|
import { s as normalizeWhatsAppMessagingTarget } from "./normalize-target-DSZnHkKF.js";
|
|
4
|
-
import { i as sendTypingWhatsApp, t as sendMessageWhatsApp } from "./send-
|
|
5
|
-
import {
|
|
4
|
+
import { i as sendTypingWhatsApp, t as sendMessageWhatsApp } from "./send-DhJVN30g.js";
|
|
5
|
+
import { i as getWhatsAppRuntime } from "./runtime-BLlToOi6.js";
|
|
6
6
|
import "./normalize-C-Z16y7Q.js";
|
|
7
|
-
import { i as unregisterWhatsAppApprovalReactionTarget, r as registerWhatsAppApprovalReactionTarget } from "./approval-reactions-
|
|
7
|
+
import { i as unregisterWhatsAppApprovalReactionTarget, r as registerWhatsAppApprovalReactionTarget } from "./approval-reactions-P2HXjmln.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-CxPuEFi-.js";
|
|
3
|
+
import { n as getOptionalWhatsAppRuntime } from "./runtime-BLlToOi6.js";
|
|
4
|
+
import { c as getWhatsAppApprovalApprovers, l as whatsappApprovalAuth } from "./group-session-key-DJSdYfnb.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
|
|
@@ -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-CU_IlbK5.js";
|
|
4
|
+
import { c as resolveComparableIdentity } from "./identity-BM4_wZeM.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-CxPuEFi-.js";
|
|
2
|
+
import { r as getWhatsAppConnectionController } from "./connection-controller-runtime-context-DG0tuYuw.js";
|
|
3
|
+
import { s as resolveJidToE164 } from "./targets-runtime-CKFrhoX4.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,17 +1,17 @@
|
|
|
1
|
-
import { a as resolveWhatsAppAccount } from "./accounts-
|
|
1
|
+
import { a as resolveWhatsAppAccount } from "./accounts-CxPuEFi-.js";
|
|
2
2
|
import { r as resolveDefaultWhatsAppAccountId, t as listAccountIds } from "./account-ids-CB5SOWjc.js";
|
|
3
3
|
import { c as normalizeWhatsAppTarget, i as looksLikeWhatsAppTargetId, n as isWhatsAppNewsletterJid, o as normalizeWhatsAppAllowFromEntry, s as normalizeWhatsAppMessagingTarget, t as isWhatsAppGroupJid } from "./normalize-target-DSZnHkKF.js";
|
|
4
4
|
import { t as resolveWhatsAppOutboundTarget } from "./resolve-outbound-target-BR97fAbB.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-
|
|
6
|
-
import {
|
|
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-DhJVN30g.js";
|
|
6
|
+
import { i as getWhatsAppRuntime } from "./runtime-BLlToOi6.js";
|
|
7
7
|
import "./normalize-C-Z16y7Q.js";
|
|
8
|
-
import {
|
|
9
|
-
import "./text-runtime-
|
|
8
|
+
import { c as toWhatsappJid } from "./targets-runtime-CKFrhoX4.js";
|
|
9
|
+
import "./text-runtime-CU_IlbK5.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-DJSdYfnb.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-CuqHFnKd.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-DirYMTbo.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";
|
|
@@ -19,6 +19,7 @@ import { normalizeLowercaseStringOrEmpty, normalizeOptionalString } from "opencl
|
|
|
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";
|
|
@@ -31,7 +32,6 @@ import { createChannelApproverDmTargetResolver, createChannelNativeOriginTargetR
|
|
|
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";
|
|
@@ -225,7 +225,7 @@ const whatsappApprovalCapability = createChannelApprovalCapability({
|
|
|
225
225
|
approvalKind,
|
|
226
226
|
request
|
|
227
227
|
}),
|
|
228
|
-
load: async () => (await import("./approval-handler.runtime-
|
|
228
|
+
load: async () => (await import("./approval-handler.runtime-C4ddB7Kc.js")).whatsappApprovalNativeRuntime
|
|
229
229
|
})
|
|
230
230
|
});
|
|
231
231
|
//#endregion
|
|
@@ -294,7 +294,8 @@ function createWhatsAppOutboundBase({ chunker, sendMessageWhatsApp, sendPollWhat
|
|
|
294
294
|
remoteJid: cachedMeta?.remoteJid ?? targetJid,
|
|
295
295
|
fromMe: cachedMeta?.fromMe ?? false,
|
|
296
296
|
participant: cachedMeta?.participant,
|
|
297
|
-
messageText: cachedMeta?.body
|
|
297
|
+
messageText: cachedMeta?.body,
|
|
298
|
+
media: cachedMeta?.media
|
|
298
299
|
};
|
|
299
300
|
};
|
|
300
301
|
const outbound = {
|
|
@@ -391,8 +392,8 @@ function createWhatsAppOutboundBase({ chunker, sendMessageWhatsApp, sendPollWhat
|
|
|
391
392
|
}
|
|
392
393
|
//#endregion
|
|
393
394
|
//#region extensions/whatsapp/src/channel-outbound.ts
|
|
394
|
-
const loadWhatsAppApprovalReactionsModule = createLazyRuntimeModule(() => import("./approval-reactions-
|
|
395
|
-
const loadWhatsAppQuestionReactionsModule = createLazyRuntimeModule(() => import("./question-reactions-
|
|
395
|
+
const loadWhatsAppApprovalReactionsModule = createLazyRuntimeModule(() => import("./approval-reactions-P2HXjmln.js").then((n) => n.t));
|
|
396
|
+
const loadWhatsAppQuestionReactionsModule = createLazyRuntimeModule(() => import("./question-reactions-CaOrSYzU.js").then((n) => n.n));
|
|
396
397
|
function normalizeWhatsAppChannelPayloadText(text) {
|
|
397
398
|
return normalizeWhatsAppPayloadTextPreservingIndentation(text);
|
|
398
399
|
}
|
|
@@ -491,7 +492,7 @@ function resolveWhatsAppMentionStripRegexes(ctx) {
|
|
|
491
492
|
//#endregion
|
|
492
493
|
//#region extensions/whatsapp/src/heartbeat.ts
|
|
493
494
|
async function checkWhatsAppHeartbeatReady(params) {
|
|
494
|
-
if (params.cfg.
|
|
495
|
+
if (params.cfg.channels?.whatsapp?.enabled === false) return {
|
|
495
496
|
ok: false,
|
|
496
497
|
reason: "whatsapp-disabled"
|
|
497
498
|
};
|
|
@@ -665,8 +666,8 @@ function collectWhatsAppStatusIssues(accounts) {
|
|
|
665
666
|
}
|
|
666
667
|
//#endregion
|
|
667
668
|
//#region extensions/whatsapp/src/channel.ts
|
|
668
|
-
const loadWhatsAppDirectoryConfig = createLazyRuntimeModule(() => import("./directory-config-
|
|
669
|
-
const loadWhatsAppChannelReactAction = createLazyRuntimeModule(() => import("./channel-react-action-
|
|
669
|
+
const loadWhatsAppDirectoryConfig = createLazyRuntimeModule(() => import("./directory-config-BTbJkV1W.js").then((n) => n.t));
|
|
670
|
+
const loadWhatsAppChannelReactAction = createLazyRuntimeModule(() => import("./channel-react-action-CBW-PA8q.js"));
|
|
670
671
|
function resolveWhatsAppTargetInfo(raw) {
|
|
671
672
|
const normalized = normalizeWhatsAppTarget(raw);
|
|
672
673
|
if (!normalized) return null;
|
|
@@ -675,6 +676,10 @@ function resolveWhatsAppTargetInfo(raw) {
|
|
|
675
676
|
chatType: isWhatsAppGroupJid(normalized) ? "group" : isWhatsAppNewsletterJid(normalized) ? "channel" : "direct"
|
|
676
677
|
};
|
|
677
678
|
}
|
|
679
|
+
function resolveWhatsAppMessageActionTarget(params) {
|
|
680
|
+
const chatJid = params.args.chatJid;
|
|
681
|
+
return typeof chatJid === "string" ? normalizeWhatsAppMessagingTarget(chatJid) : void 0;
|
|
682
|
+
}
|
|
678
683
|
const whatsappPlugin = createChatChannelPlugin({
|
|
679
684
|
pairing: {
|
|
680
685
|
idLabel: "whatsappSenderId",
|
|
@@ -696,9 +701,8 @@ const whatsappPlugin = createChatChannelPlugin({
|
|
|
696
701
|
},
|
|
697
702
|
setupWizard: whatsappSetupWizardProxy,
|
|
698
703
|
setup: whatsappSetupAdapter,
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
}
|
|
704
|
+
setupContract: whatsappSetupContract,
|
|
705
|
+
isConfigured: async (account) => await isWhatsAppAuthConfigured(account.authDir)
|
|
702
706
|
}),
|
|
703
707
|
agentTools: () => [createWhatsAppLoginTool()],
|
|
704
708
|
allowlist: buildDmGroupAccountAllowlistAdapter({
|
|
@@ -770,6 +774,11 @@ const whatsappPlugin = createChatChannelPlugin({
|
|
|
770
774
|
listGroupsLive: async (params) => (await loadWhatsAppDirectoryConfig()).listWhatsAppDirectoryGroupsLive(params)
|
|
771
775
|
},
|
|
772
776
|
actions: {
|
|
777
|
+
messageActionTargetAliases: { react: {
|
|
778
|
+
aliases: ["chatJid", "messageId"],
|
|
779
|
+
deliveryTargetAliases: ["chatJid"],
|
|
780
|
+
resolveDeliveryTarget: resolveWhatsAppMessageActionTarget
|
|
781
|
+
} },
|
|
773
782
|
describeMessageTool: ({ cfg, accountId }) => describeWhatsAppMessageActions({
|
|
774
783
|
cfg,
|
|
775
784
|
accountId
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as WhatsAppChannelConfigSchema } from "./config-schema-
|
|
1
|
+
import { t as WhatsAppChannelConfigSchema } from "./config-schema-C6IeKIC0.js";
|
|
2
2
|
export { WhatsAppChannelConfigSchema };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as whatsappPlugin } from "./channel-
|
|
1
|
+
import { t as whatsappPlugin } from "./channel-B9xjrOGG.js";
|
|
2
2
|
export { whatsappPlugin };
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import { a as resolveWhatsAppAccount, s as resolveWhatsAppMediaMaxBytes } from "./accounts-
|
|
1
|
+
import { a as resolveWhatsAppAccount, s as resolveWhatsAppMediaMaxBytes } from "./accounts-CxPuEFi-.js";
|
|
2
2
|
import { c as normalizeWhatsAppTarget, t as isWhatsAppGroupJid } from "./normalize-target-DSZnHkKF.js";
|
|
3
|
-
import { r as resolveAuthorizedWhatsAppOutboundTarget, t as handleWhatsAppAction } from "./action-runtime-
|
|
4
|
-
import { t as sendMessageWhatsApp } from "./send-
|
|
3
|
+
import { r as resolveAuthorizedWhatsAppOutboundTarget, t as handleWhatsAppAction } from "./action-runtime-CHU7xb6o.js";
|
|
4
|
+
import { t as sendMessageWhatsApp } from "./send-DhJVN30g.js";
|
|
5
5
|
import "./normalize-C-Z16y7Q.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-DirYMTbo.js";
|
|
3
|
+
import { t as getActiveWebListener$1 } from "./active-listener-BEjWsCNM.js";
|
|
4
|
+
import { t as monitorWebChannel$1 } from "./monitor-CBVNJ2lb.js";
|
|
5
|
+
import { t as loginWeb$1 } from "./login-BKUm7KSk.js";
|
|
6
|
+
import { whatsappSetupWizard as whatsappSetupWizard$1 } from "./setup-surface-Kv3mPki2.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-CuqHFnKd.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
|
};
|
|
@@ -12,6 +12,12 @@ const WhatsAppChannelConfigSchema = buildChannelConfigSchema(WhatsAppConfigSchem
|
|
|
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)."
|
|
@@ -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-DirYMTbo.js";
|
|
4
|
+
import { c as resolveComparableIdentity } from "./identity-BM4_wZeM.js";
|
|
5
|
+
import { a as waitForWaConnection, m as acquireWhatsAppGatewayConnectionOwner, o as DEFAULT_WHATSAPP_SOCKET_TIMING, r as createWaSocket, t as closeWhatsAppSocketAndWait } from "./socket-close-BoSHhQNJ.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,
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { t as
|
|
1
|
+
import { t as getOptionalWhatsAppChannelRuntime } from "./runtime-BLlToOi6.js";
|
|
2
2
|
import { getChannelRuntimeContext } from "openclaw/plugin-sdk/channel-runtime-context";
|
|
3
3
|
//#region extensions/whatsapp/src/connection-controller-runtime-context.ts
|
|
4
4
|
const WHATSAPP_CONNECTION_CONTROLLER_CAPABILITY = "connection-controller";
|
|
5
5
|
const WHATSAPP_CONNECTION_OWNER_PENDING_CAPABILITY = "connection-owner-pending";
|
|
6
6
|
function getWhatsAppConnectionController(accountId) {
|
|
7
7
|
return getChannelRuntimeContext({
|
|
8
|
-
channelRuntime:
|
|
8
|
+
channelRuntime: getOptionalWhatsAppChannelRuntime() ?? void 0,
|
|
9
9
|
channelId: "whatsapp",
|
|
10
10
|
accountId,
|
|
11
11
|
capability: "connection-controller"
|
|
@@ -13,7 +13,7 @@ function getWhatsAppConnectionController(accountId) {
|
|
|
13
13
|
}
|
|
14
14
|
function hasPendingWhatsAppConnectionOwner(accountId) {
|
|
15
15
|
return Boolean(getChannelRuntimeContext({
|
|
16
|
-
channelRuntime:
|
|
16
|
+
channelRuntime: getOptionalWhatsAppChannelRuntime() ?? void 0,
|
|
17
17
|
channelId: "whatsapp",
|
|
18
18
|
accountId,
|
|
19
19
|
capability: WHATSAPP_CONNECTION_OWNER_PENDING_CAPABILITY
|
package/dist/contract-api.js
CHANGED
|
@@ -2,7 +2,7 @@ import { c as normalizeWhatsAppTarget$1, t as isWhatsAppGroupJid$1 } from "./nor
|
|
|
2
2
|
import { t as whatsappCommandPolicy$1 } from "./command-policy-BIOSHySD.js";
|
|
3
3
|
import { t as resolveLegacyGroupSessionKey$1 } from "./group-session-contract-DDnZSsJ1.js";
|
|
4
4
|
import { r as isLegacyGroupSessionKey$1, t as canonicalizeLegacySessionKey$1 } from "./session-contract-DMTm6Q_L.js";
|
|
5
|
-
import { a as resolveWhatsAppRuntimeGroupPolicy$1, n as testing } from "./access-control-
|
|
5
|
+
import { a as resolveWhatsAppRuntimeGroupPolicy$1, n as testing } from "./access-control-CRz_v6bR.js";
|
|
6
6
|
//#region extensions/whatsapp/contract-api.ts
|
|
7
7
|
const canonicalizeLegacySessionKey = canonicalizeLegacySessionKey$1;
|
|
8
8
|
const isLegacyGroupSessionKey = isLegacyGroupSessionKey$1;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { t as __exportAll } from "./rolldown-runtime-D7D4PA-g.js";
|
|
2
|
-
import { c as resolveMergedWhatsAppAccountConfig, o as resolveWhatsAppAuthDir } from "./accounts-
|
|
2
|
+
import { c as resolveMergedWhatsAppAccountConfig, o as resolveWhatsAppAuthDir } from "./accounts-CxPuEFi-.js";
|
|
3
3
|
import { c as normalizeWhatsAppTarget, t as isWhatsAppGroupJid } from "./normalize-target-DSZnHkKF.js";
|
|
4
|
-
import { i as hasPendingWhatsAppConnectionOwner, r as getWhatsAppConnectionController } from "./connection-controller-runtime-context-
|
|
4
|
+
import { i as hasPendingWhatsAppConnectionOwner, r as getWhatsAppConnectionController } from "./connection-controller-runtime-context-DG0tuYuw.js";
|
|
5
5
|
import "./normalize-C-Z16y7Q.js";
|
|
6
|
-
import { f as readWebAuthExistsForDecision, w as waitForCredsSaveQueueWithTimeout } from "./auth-store-
|
|
7
|
-
import { n as resolveWebAccountId } from "./active-listener-
|
|
8
|
-
import { a as waitForWaConnection, h as acquireWhatsAppStandaloneConnectionOwner, n as createWaDirectorySocket, p as WhatsAppConnectionOwnerBusyError, t as closeWhatsAppSocketAndWait } from "./socket-close-
|
|
6
|
+
import { f as readWebAuthExistsForDecision, w as waitForCredsSaveQueueWithTimeout } from "./auth-store-DirYMTbo.js";
|
|
7
|
+
import { n as resolveWebAccountId } from "./active-listener-BEjWsCNM.js";
|
|
8
|
+
import { a as waitForWaConnection, h as acquireWhatsAppStandaloneConnectionOwner, n as createWaDirectorySocket, p as WhatsAppConnectionOwnerBusyError, t as closeWhatsAppSocketAndWait } from "./socket-close-BoSHhQNJ.js";
|
|
9
9
|
import { listResolvedDirectoryGroupEntriesFromMapKeys, listResolvedDirectoryUserEntriesFromAllowFrom } from "openclaw/plugin-sdk/directory-config-runtime";
|
|
10
10
|
//#region extensions/whatsapp/src/directory-config.ts
|
|
11
11
|
var directory_config_exports = /* @__PURE__ */ __exportAll({
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as listWhatsAppDirectoryGroupsFromConfig, r as listWhatsAppDirectoryPeersFromConfig } from "./directory-config-
|
|
1
|
+
import { n as listWhatsAppDirectoryGroupsFromConfig, r as listWhatsAppDirectoryPeersFromConfig } from "./directory-config-BTbJkV1W.js";
|
|
2
2
|
//#region extensions/whatsapp/directory-contract-api.ts
|
|
3
3
|
const whatsappDirectoryContractPlugin = {
|
|
4
4
|
id: "whatsapp",
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
//#region extensions/whatsapp/src/doctor.ts
|
|
2
|
+
function normalizeCompatibilityConfig({ cfg }) {
|
|
3
|
+
return {
|
|
4
|
+
config: cfg,
|
|
5
|
+
changes: []
|
|
6
|
+
};
|
|
7
|
+
}
|
|
8
|
+
const whatsappDoctor = { normalizeCompatibilityConfig };
|
|
9
|
+
//#endregion
|
|
10
|
+
export { whatsappDoctor as n, normalizeCompatibilityConfig as t };
|