@openclaw/whatsapp 2026.9.1-beta.1 → 2026.9.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (75) hide show
  1. package/dist/{accounts-BX2fZUyR.js → accounts-CiKHiuEe.js} +10 -27
  2. package/dist/{action-runtime-C075e6OP.js → action-runtime-CRZLhN3f.js} +2 -2
  3. package/dist/action-runtime-api.js +1 -1
  4. package/dist/action-runtime.runtime.js +1 -1
  5. package/dist/agent-tools-api.js +3 -3
  6. package/dist/api.js +10 -10
  7. package/dist/{approval-handler.runtime-CljxfPJz.js → approval-handler.runtime-C2cpkbpY.js} +8 -4
  8. package/dist/{approval-reactions-Jyr1JaAK.js → approval-reactions-DrZe-NmN.js} +7 -5
  9. package/dist/auth-presence.js +1 -1
  10. package/dist/{auth-store-CtpBqH5S.js → auth-store-ZWaclAbd.js} +8 -6
  11. package/dist/channel-config-api.js +1 -1
  12. package/dist/{channel-C4FMOZTE.js → channel-dwfgnadr.js} +56 -66
  13. package/dist/channel-plugin-api.js +1 -1
  14. package/dist/{channel-react-action-Bhp2BYRr.js → channel-react-action-CHeJSG9F.js} +3 -3
  15. package/dist/{channel.runtime-CrahUvcb.js → channel.runtime-Bn3K5Ygb.js} +4 -4
  16. package/dist/{channel.setup-CGcBvnpP.js → channel.setup-DckQm9ma.js} +1 -1
  17. package/dist/{config-schema-BQP5YCeK.js → config-schema-BYA6e_Ii.js} +6 -4
  18. package/dist/{connection-controller-CIYuBJrs.js → connection-controller-DNp6U1NN.js} +2 -2
  19. package/dist/{constants-HU41RHGI.js → constants-C7m81BNe.js} +1 -1
  20. package/dist/{creds-files-W6B3EMZ8.js → creds-files-Drg3usj1.js} +1 -1
  21. package/dist/{directory-config-P7_3U73Z.js → directory-config-CoWFw1zn.js} +3 -3
  22. package/dist/directory-contract-api.js +1 -1
  23. package/dist/doctor-BPb-SjdE.js +65 -0
  24. package/dist/doctor-contract-api.js +21 -3
  25. package/dist/{group-session-key-DmFc_Cqi.js → group-session-key-BmVDSPr1.js} +11 -12
  26. package/dist/light-runtime-api.js +1 -1
  27. package/dist/{login-BkpKpndm.js → login-6j2iP9nR.js} +6 -5
  28. package/dist/{login-qr-DY4VFgOq.js → login-qr-DRFgI6k1.js} +9 -7
  29. package/dist/login-qr-runtime.js +1 -1
  30. package/dist/{monitor-C_Nw23PZ.js → monitor-Bc6DC5jl.js} +189 -156
  31. package/dist/{question-reactions-D3eAeB0i.js → question-reactions-bbe0Qnjn.js} +1 -1
  32. package/dist/runtime-api.js +9 -9
  33. package/dist/{send-DLMUc2uZ.js → send-BDDGPxav.js} +53 -28
  34. package/dist/{send-api-BtK45TmZ.js → send-api-C_Zn4Ij-.js} +48 -48
  35. package/dist/{setup-finalize-C1nij8NS.js → setup-finalize-gLmc3FTV.js} +7 -6
  36. package/dist/setup-plugin-api.js +1 -1
  37. package/dist/{setup-surface-CjjqIxQP.js → setup-surface-twIi4TdN.js} +3 -3
  38. package/dist/{shared-BekHi69d.js → shared-ByeKDmh0.js} +13 -8
  39. package/dist/{socket-close-2T0_jZTN.js → socket-close-B3X9uerq.js} +10 -7
  40. package/dist/{targets-runtime-TMk0lGuy.js → targets-runtime-RBjx3pg_.js} +1 -2
  41. package/dist/{text-runtime-CaKLhowd.js → text-runtime-DyfmcATV.js} +1 -1
  42. package/node_modules/baileys/node_modules/process-warning/.github/dependabot.yml +42 -2
  43. package/node_modules/baileys/node_modules/process-warning/.github/workflows/ci.yml +12 -1
  44. package/node_modules/baileys/node_modules/process-warning/.github/workflows/lock-threads.yml +19 -0
  45. package/node_modules/baileys/node_modules/process-warning/LICENSE +1 -1
  46. package/node_modules/baileys/node_modules/process-warning/README.md +41 -2
  47. package/node_modules/baileys/node_modules/process-warning/index.js +85 -17
  48. package/node_modules/baileys/node_modules/process-warning/package.json +6 -7
  49. package/node_modules/baileys/node_modules/process-warning/test/emit-once-only.test.js +3 -3
  50. package/node_modules/baileys/node_modules/process-warning/test/emit-reset.test.js +4 -4
  51. package/node_modules/baileys/node_modules/process-warning/test/emit-unlimited.test.js +2 -2
  52. package/node_modules/baileys/node_modules/process-warning/test/spy-warning.test.js +143 -0
  53. package/node_modules/baileys/node_modules/process-warning/types/index.d.ts +15 -1
  54. package/node_modules/baileys/node_modules/process-warning/types/index.tst.ts +48 -0
  55. package/node_modules/baileys/node_modules/ws/lib/permessage-deflate.js +3 -1
  56. package/node_modules/baileys/node_modules/ws/package.json +1 -1
  57. package/node_modules/typebox/build/format/email.mjs +1 -1
  58. package/node_modules/typebox/build/format/idna/idn-hostname.mjs +19 -1
  59. package/node_modules/typebox/build/format/json_pointer.d.mts +2 -2
  60. package/node_modules/typebox/build/format/json_pointer.mjs +2 -2
  61. package/node_modules/typebox/build/format/json_pointer_uri_fragment.d.mts +2 -2
  62. package/node_modules/typebox/build/format/json_pointer_uri_fragment.mjs +2 -2
  63. package/node_modules/typebox/build/format/relative_json_pointer.d.mts +2 -2
  64. package/node_modules/typebox/build/format/relative_json_pointer.mjs +2 -2
  65. package/node_modules/typebox/build/system/memory/assign.mjs +2 -1
  66. package/node_modules/typebox/build/system/memory/create.mjs +3 -4
  67. package/node_modules/typebox/build/system/memory/discard.mjs +2 -2
  68. package/node_modules/typebox/build/system/memory/freeze.d.mts +4 -0
  69. package/node_modules/typebox/build/system/memory/freeze.mjs +6 -0
  70. package/node_modules/typebox/build/system/memory/update.mjs +3 -2
  71. package/node_modules/typebox/package.json +1 -1
  72. package/openclaw.plugin.json +0 -1
  73. package/package.json +7 -6
  74. package/dist/doctor-CwzVXKoE.js +0 -10
  75. package/node_modules/baileys/node_modules/process-warning/types/index.test-d.ts +0 -36
@@ -0,0 +1,65 @@
1
+ import { asObjectRecord, collectChannelAccountScopes } from "openclaw/plugin-sdk/runtime-doctor-migrations";
2
+ //#region extensions/whatsapp/src/doctor.ts
3
+ function resolveLegacyAckScope(ack) {
4
+ const direct = ack.direct !== false;
5
+ const group = ack.group ?? "mentions";
6
+ if (direct) return group === "always" ? "all" : group === "never" ? "direct" : void 0;
7
+ return group === "always" ? "group-all" : group === "mentions" ? "group-mentions" : group === "never" ? "off" : void 0;
8
+ }
9
+ function resolveDefaultAgentEmoji(cfg) {
10
+ const entries = asObjectRecord(asObjectRecord(cfg.agents)?.entries);
11
+ const agents = entries ? Object.values(entries).flatMap((value) => {
12
+ const entry = asObjectRecord(value);
13
+ return entry ? [entry] : [];
14
+ }) : [];
15
+ const agent = agents.find((entry) => entry.default === true) ?? agents[0];
16
+ const emoji = asObjectRecord(agent?.identity)?.emoji;
17
+ return typeof emoji === "string" ? emoji : void 0;
18
+ }
19
+ function normalizeCompatibilityConfig({ cfg }) {
20
+ const changes = [];
21
+ const sources = [];
22
+ for (const scope of collectChannelAccountScopes({
23
+ cfg,
24
+ channelId: "whatsapp"
25
+ })) {
26
+ const ack = asObjectRecord(scope.account.ackReaction);
27
+ if (!ack) continue;
28
+ sources.push({
29
+ path: `${scope.prefix}.ackReaction`,
30
+ account: scope.account,
31
+ ...typeof ack.emoji === "string" ? { emoji: ack.emoji } : {},
32
+ scope: resolveLegacyAckScope(ack),
33
+ unrepresentableScope: ack.direct !== false && (ack.group ?? "mentions") === "mentions"
34
+ });
35
+ }
36
+ if (sources.length === 0) return {
37
+ config: cfg,
38
+ changes
39
+ };
40
+ const messages = cfg.messages ??= {};
41
+ const identityEmoji = resolveDefaultAgentEmoji(cfg) ?? "👀";
42
+ for (const source of sources) {
43
+ messages.ackReaction ??= source.emoji ?? identityEmoji;
44
+ messages.ackReactionScope ??= source.scope;
45
+ delete source.account.ackReaction;
46
+ changes.push(`Moved translatable ${source.path} settings to messages ack settings.`);
47
+ }
48
+ const finalEmoji = messages.ackReaction.trim();
49
+ const finalScope = messages.ackReactionScope ?? "group-mentions";
50
+ const comparableFinalScope = finalScope === "none" ? "off" : finalScope;
51
+ for (const source of sources) {
52
+ const sourceEmoji = source.emoji?.trim();
53
+ if (source.emoji === void 0) changes.push(`${source.path} used a route-dependent agent identity acknowledgement emoji before migration; the final messages.ackReaction is ${JSON.stringify(finalEmoji)}. Review messages.ackReaction.`);
54
+ else if (sourceEmoji !== finalEmoji) changes.push(`${source.path} requested acknowledgement emoji ${JSON.stringify(sourceEmoji)}, but the final messages.ackReaction is ${JSON.stringify(finalEmoji)}. Review messages.ackReaction.`);
55
+ if (source.unrepresentableScope) changes.push(`${source.path} migration cannot preserve both direct-message and mentioned-group acknowledgements; the final messages.ackReactionScope is ${JSON.stringify(finalScope)}. Review messages.ackReactionScope.`);
56
+ else if (source.scope && source.scope !== comparableFinalScope) changes.push(`${source.path} requested acknowledgement scope ${JSON.stringify(source.scope)}, but the final messages.ackReactionScope is ${JSON.stringify(finalScope)}. Review messages.ackReactionScope.`);
57
+ }
58
+ return {
59
+ config: cfg,
60
+ changes
61
+ };
62
+ }
63
+ const whatsappDoctor = { normalizeCompatibilityConfig };
64
+ //#endregion
65
+ export { whatsappDoctor as n, normalizeCompatibilityConfig as t };
@@ -1,8 +1,8 @@
1
- import { i as isWhatsAppBaileysAuthFileName } from "./creds-files-W6B3EMZ8.js";
2
- import { t as normalizeCompatibilityConfig$1 } from "./doctor-CwzVXKoE.js";
1
+ import { i as isWhatsAppBaileysAuthFileName } from "./creds-files-Drg3usj1.js";
2
+ import { t as normalizeCompatibilityConfig$1 } from "./doctor-BPb-SjdE.js";
3
3
  import fs from "node:fs";
4
4
  import path from "node:path";
5
- import { fileExists } from "openclaw/plugin-sdk/security-runtime";
5
+ import { fileExists } from "openclaw/plugin-sdk/file-access-runtime";
6
6
  import { DEFAULT_ACCOUNT_ID } from "openclaw/plugin-sdk/account-id";
7
7
  import { asObjectRecord, defineChannelAliasMigration, definePluginDoctorMigrationFromPlans, hasLegacyAccountStreamingAliases, stripRetiredChannelKeys } from "openclaw/plugin-sdk/runtime-doctor-migrations";
8
8
  //#region extensions/whatsapp/src/state-migrations.ts
@@ -38,8 +38,26 @@ const streamingAliasMigration = defineChannelAliasMigration({
38
38
  accountStreamingInheritsDefaultAccount: true
39
39
  });
40
40
  const hasExposeErrorText = (value) => Object.hasOwn(asObjectRecord(value) ?? {}, "exposeErrorText");
41
+ const hasAckReaction = (value) => Boolean(asObjectRecord(asObjectRecord(value)?.ackReaction));
41
42
  const legacyConfigRules = [
42
43
  ...streamingAliasMigration.legacyConfigRules,
44
+ {
45
+ path: [
46
+ "channels",
47
+ "whatsapp",
48
+ "ackReaction"
49
+ ],
50
+ message: "channels.whatsapp.ackReaction moved to global message acknowledgement settings. Run \"openclaw doctor --fix\"."
51
+ },
52
+ {
53
+ path: [
54
+ "channels",
55
+ "whatsapp",
56
+ "accounts"
57
+ ],
58
+ message: "channels.whatsapp.accounts.<id>.ackReaction moved to global message acknowledgement settings. Run \"openclaw doctor --fix\".",
59
+ match: (value) => hasLegacyAccountStreamingAliases(value, hasAckReaction)
60
+ },
43
61
  {
44
62
  path: [
45
63
  "channels",
@@ -1,8 +1,8 @@
1
- import { a as resolveWhatsAppAccount } from "./accounts-BX2fZUyR.js";
1
+ import { a as resolveWhatsAppAccount } from "./accounts-CiKHiuEe.js";
2
2
  import { c as normalizeWhatsAppTarget } from "./normalize-target-CugRyONv.js";
3
3
  import "./normalize-C7Hkc_vE.js";
4
- import { r as jidToE164 } from "./targets-runtime-TMk0lGuy.js";
5
- import "./text-runtime-CaKLhowd.js";
4
+ import { r as jidToE164 } from "./targets-runtime-RBjx3pg_.js";
5
+ import "./text-runtime-DyfmcATV.js";
6
6
  import { formatMediaPlaceholderText } from "openclaw/plugin-sdk/channel-inbound";
7
7
  import { createChannelApprovalAuth } from "openclaw/plugin-sdk/approval-auth-runtime";
8
8
  import { isHostedLidUser, isHostedPnUser, isLidUser, isPnUser } from "baileys";
@@ -32,7 +32,7 @@ const getWhatsAppApprovalApprovers = whatsappApproval.resolveApprovers;
32
32
  const whatsappApprovalAuth = whatsappApproval.approvalAuth;
33
33
  //#endregion
34
34
  //#region extensions/whatsapp/src/quoted-message.ts
35
- const CACHE_TTL_MS = 600 * 1e3;
35
+ const CACHE_TTL_MS = 6e5;
36
36
  const MAX_ENTRIES = 500;
37
37
  const cache = /* @__PURE__ */ new Map();
38
38
  function makeCacheKey(accountId, remoteJid, messageId) {
@@ -140,17 +140,16 @@ function resolveQuotedRemoteJid(params) {
140
140
  function buildQuotedMessageOptions(params) {
141
141
  const id = params.messageId?.trim();
142
142
  const quotedRemoteJid = params.remoteJid?.trim();
143
- if (!id || !quotedRemoteJid) return;
144
- const remoteJid = resolveQuotedRemoteJid({
145
- destinationJid: params.destinationJid,
146
- lookupTargetJid: params.lookupTargetJid,
147
- quotedRemoteJid,
148
- requestedJid: params.requestedJid
149
- });
150
143
  const previewText = [params.messageText, formatMediaPlaceholderText(params.media ? [params.media] : [])].filter(Boolean).join("\n");
144
+ if (!id || !quotedRemoteJid || !previewText) return;
151
145
  return { quoted: {
152
146
  key: {
153
- remoteJid,
147
+ remoteJid: resolveQuotedRemoteJid({
148
+ destinationJid: params.destinationJid,
149
+ lookupTargetJid: params.lookupTargetJid,
150
+ quotedRemoteJid,
151
+ requestedJid: params.requestedJid
152
+ }),
154
153
  id,
155
154
  fromMe: params.fromMe ?? false,
156
155
  participant: params.participant
@@ -1,5 +1,5 @@
1
1
  import { t as createWhatsAppLoginTool } from "./agent-tools-login-B-2qZPzc.js";
2
- import { c as logoutWeb, g as readWebSelfId, l as pickWebChannel, o as getWebAuthAgeMs, s as logWebSelfId, t as WA_WEB_AUTH_DIR, x as webAuthExists, y as resolveDefaultWebAuthDir } from "./auth-store-CtpBqH5S.js";
2
+ import { c as logoutWeb, g as readWebSelfId, l as pickWebChannel, o as getWebAuthAgeMs, s as logWebSelfId, t as WA_WEB_AUTH_DIR, x as webAuthExists, y as resolveDefaultWebAuthDir } from "./auth-store-ZWaclAbd.js";
3
3
  import { t as getActiveWebListener } from "./active-listener-BEjWsCNM.js";
4
4
  import { n as getStatusCode, t as formatError } from "./session-errors-JuazczrA.js";
5
5
  export { WA_WEB_AUTH_DIR, createWhatsAppLoginTool, formatError, getActiveWebListener, getStatusCode, getWebAuthAgeMs, logWebSelfId, logoutWeb, pickWebChannel, readWebSelfId, resolveDefaultWebAuthDir, webAuthExists };
@@ -1,8 +1,8 @@
1
1
  import { t as __exportAll } from "./rolldown-runtime-D7D4PA-g.js";
2
- import { a as resolveWhatsAppAccount } from "./accounts-BX2fZUyR.js";
3
- import { b as restoreCredsFromBackupIfNeeded } from "./auth-store-CtpBqH5S.js";
4
- import { f as renderQrTerminal, r as createWaSocket, u as resolveWhatsAppSocketTiming } from "./socket-close-2T0_jZTN.js";
5
- import { a as closeWaSocketSoon, o as waitForWhatsAppLoginResult } from "./connection-controller-CIYuBJrs.js";
2
+ import { a as resolveWhatsAppAccount } from "./accounts-CiKHiuEe.js";
3
+ import { b as restoreCredsFromBackupIfNeeded } from "./auth-store-ZWaclAbd.js";
4
+ import { f as renderQrTerminal, r as createWaSocket, u as resolveWhatsAppSocketTiming } from "./socket-close-B3X9uerq.js";
5
+ import { a as closeWaSocketSoon, o as waitForWhatsAppLoginResult } from "./connection-controller-DNp6U1NN.js";
6
6
  import { formatCliCommand } from "openclaw/plugin-sdk/cli-runtime";
7
7
  import { logInfo } from "openclaw/plugin-sdk/logging-core";
8
8
  import { danger, defaultRuntime, success } from "openclaw/plugin-sdk/runtime-env";
@@ -12,8 +12,9 @@ var login_exports = /* @__PURE__ */ __exportAll({ loginWeb: () => loginWeb });
12
12
  const QR_LINK_INSTRUCTION = "Open the WhatsApp app, go to Linked Devices, then scan this QR:";
13
13
  const CLEAR_TERMINAL = "\x1B[2J\x1B[H";
14
14
  async function loginWeb(verbose, waitForConnection, runtime = defaultRuntime, accountId, options) {
15
+ const cfg = getRuntimeConfig();
15
16
  const account = resolveWhatsAppAccount({
16
- cfg: getRuntimeConfig(),
17
+ cfg,
17
18
  accountId
18
19
  });
19
20
  const socketTiming = resolveWhatsAppSocketTiming();
@@ -1,9 +1,9 @@
1
- import { a as resolveWhatsAppAccount } from "./accounts-BX2fZUyR.js";
2
- import { c as logoutWeb, f as readWebAuthExistsForDecision, g as readWebSelfId, n as WHATSAPP_AUTH_UNSTABLE_CODE } from "./auth-store-CtpBqH5S.js";
1
+ import { a as resolveWhatsAppAccount } from "./accounts-CiKHiuEe.js";
2
+ import { c as logoutWeb, f as readWebAuthExistsForDecision, g as readWebSelfId, n as WHATSAPP_AUTH_UNSTABLE_CODE } from "./auth-store-ZWaclAbd.js";
3
3
  import { t as getActiveWebListener } from "./active-listener-BEjWsCNM.js";
4
- import { r as createWaSocket, u as resolveWhatsAppSocketTiming } from "./socket-close-2T0_jZTN.js";
4
+ import { r as createWaSocket, u as resolveWhatsAppSocketTiming } from "./socket-close-B3X9uerq.js";
5
5
  import { t as formatError } from "./session-errors-JuazczrA.js";
6
- import { i as closeWaSocket, o as waitForWhatsAppLoginResult, t as WHATSAPP_LOGGED_OUT_QR_MESSAGE } from "./connection-controller-CIYuBJrs.js";
6
+ import { i as closeWaSocket, o as waitForWhatsAppLoginResult, t as WHATSAPP_LOGGED_OUT_QR_MESSAGE } from "./connection-controller-DNp6U1NN.js";
7
7
  import { logInfo } from "openclaw/plugin-sdk/logging-core";
8
8
  import { danger, defaultRuntime, info, success } from "openclaw/plugin-sdk/runtime-env";
9
9
  import { renderQrPngDataUrl } from "openclaw/plugin-sdk/media-runtime";
@@ -16,7 +16,7 @@ function waitForNextTask() {
16
16
  setImmediate(resolve);
17
17
  });
18
18
  }
19
- const ACTIVE_LOGIN_TTL_MS = 3 * 6e4;
19
+ const ACTIVE_LOGIN_TTL_MS = 18e4;
20
20
  const MAX_QR_RENDER_CHASES = 10;
21
21
  const activeLogins = /* @__PURE__ */ new Map();
22
22
  function resolveWhatsAppLoginTimeoutMs(value, fallbackMs, minMs) {
@@ -186,8 +186,9 @@ async function waitForQrOrRecoveredLogin(params) {
186
186
  }
187
187
  async function startWebLoginWithQr(opts = {}) {
188
188
  const runtime = opts.runtime ?? defaultRuntime;
189
+ const cfg = getRuntimeConfig();
189
190
  const account = resolveWhatsAppAccount({
190
- cfg: getRuntimeConfig(),
191
+ cfg,
191
192
  accountId: opts.accountId
192
193
  });
193
194
  const socketTiming = resolveWhatsAppSocketTiming();
@@ -351,8 +352,9 @@ async function startWebLoginWithQr(opts = {}) {
351
352
  }
352
353
  async function waitForWebLogin(opts = {}) {
353
354
  const runtime = opts.runtime ?? defaultRuntime;
355
+ const cfg = getRuntimeConfig();
354
356
  const account = resolveWhatsAppAccount({
355
- cfg: getRuntimeConfig(),
357
+ cfg,
356
358
  accountId: opts.accountId
357
359
  });
358
360
  const activeLogin = activeLogins.get(account.accountId);
@@ -1,6 +1,6 @@
1
1
  import { createLazyRuntimeModule } from "openclaw/plugin-sdk/lazy-runtime";
2
2
  //#region extensions/whatsapp/login-qr-runtime.ts
3
- const loadLoginQrModule = createLazyRuntimeModule(() => import("./login-qr-DY4VFgOq.js"));
3
+ const loadLoginQrModule = createLazyRuntimeModule(() => import("./login-qr-DRFgI6k1.js"));
4
4
  async function startWebLoginWithQr(...args) {
5
5
  const { startWebLoginWithQr: startWebLoginWithQrLocal } = await loadLoginQrModule();
6
6
  return await startWebLoginWithQrLocal(...args);