@openclaw/whatsapp 2026.5.31-beta.1 → 2026.5.31-beta.3

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 (109) hide show
  1. package/README.md +11 -0
  2. package/dist/api.js +7 -7
  3. package/dist/{channel-DA2BAIo5.js → channel-DigzkmDO.js} +1 -1
  4. package/dist/channel-plugin-api.js +1 -1
  5. package/dist/{channel.runtime-Q1LZDB5s.js → channel.runtime-BzDa8nVv.js} +2 -2
  6. package/dist/{channel.setup-DHXOo4h5.js → channel.setup-BRev7Qpj.js} +1 -1
  7. package/dist/login-qr-runtime.js +4 -4
  8. package/dist/{monitor-BVRq04Dt.js → monitor-D-vg4gJF.js} +9 -9
  9. package/dist/runtime-api.js +1 -1
  10. package/dist/{setup-core-OvPMaAsx.js → setup-core-D0ncRoh8.js} +5 -5
  11. package/dist/{setup-finalize-Dk23pfKc.js → setup-finalize-BdztDwTy.js} +1 -1
  12. package/dist/setup-plugin-api.js +1 -1
  13. package/dist/{setup-surface-F-jVrH8u.js → setup-surface-DLueEnfx.js} +1 -1
  14. package/node_modules/audio-buffer/.eslintrc.json +44 -0
  15. package/node_modules/audio-buffer/.github/workflows/node.js.yml +31 -0
  16. package/node_modules/audio-buffer/.travis.yml +7 -0
  17. package/node_modules/{@audio/decode-opus → audio-buffer}/LICENSE +2 -5
  18. package/node_modules/audio-buffer/index.js +76 -0
  19. package/node_modules/audio-buffer/package.json +37 -0
  20. package/node_modules/audio-buffer/readme.md +56 -0
  21. package/node_modules/audio-decode/.eslintrc.json +43 -0
  22. package/node_modules/audio-decode/.github/workflows/test.js.yml +20 -11
  23. package/node_modules/audio-decode/.travis.yml +13 -0
  24. package/node_modules/audio-decode/audio-decode.d.ts +10 -48
  25. package/node_modules/audio-decode/audio-decode.js +77 -193
  26. package/node_modules/audio-decode/package.json +21 -49
  27. package/node_modules/audio-decode/readme.md +29 -129
  28. package/node_modules/audio-decode/tea.yaml +6 -0
  29. package/node_modules/audio-decode/test-case.js +11 -0
  30. package/node_modules/audio-decode/test.html +10 -29
  31. package/node_modules/audio-decode/test.js +107 -0
  32. package/node_modules/node-wav/README.md +35 -0
  33. package/node_modules/node-wav/file.wav +0 -0
  34. package/node_modules/node-wav/index.js +291 -0
  35. package/node_modules/node-wav/package.json +29 -0
  36. package/node_modules/node-wav/tests/file1.wav +0 -0
  37. package/node_modules/node-wav/tests/test.js +66 -0
  38. package/node_modules/node-wav/x.js +12 -0
  39. package/node_modules/node-wav/x.json +86702 -0
  40. package/node_modules/node-wav/x.js~ +13 -0
  41. package/npm-shrinkwrap.json +32 -149
  42. package/package.json +7 -6
  43. package/node_modules/@audio/decode-aac/LICENSE +0 -9
  44. package/node_modules/@audio/decode-aac/README.md +0 -60
  45. package/node_modules/@audio/decode-aac/decode-aac.d.ts +0 -16
  46. package/node_modules/@audio/decode-aac/decode-aac.js +0 -391
  47. package/node_modules/@audio/decode-aac/package.json +0 -47
  48. package/node_modules/@audio/decode-aac/src/aac.wasm.cjs +0 -0
  49. package/node_modules/@audio/decode-aiff/LICENSE +0 -21
  50. package/node_modules/@audio/decode-aiff/README.md +0 -53
  51. package/node_modules/@audio/decode-aiff/decode-aiff.d.ts +0 -16
  52. package/node_modules/@audio/decode-aiff/decode-aiff.js +0 -583
  53. package/node_modules/@audio/decode-aiff/package.json +0 -42
  54. package/node_modules/@audio/decode-amr/LICENSE +0 -191
  55. package/node_modules/@audio/decode-amr/README.md +0 -65
  56. package/node_modules/@audio/decode-amr/decode-amr.d.ts +0 -16
  57. package/node_modules/@audio/decode-amr/decode-amr.js +0 -159
  58. package/node_modules/@audio/decode-amr/package.json +0 -48
  59. package/node_modules/@audio/decode-amr/src/amr.wasm.cjs +0 -0
  60. package/node_modules/@audio/decode-caf/LICENSE +0 -21
  61. package/node_modules/@audio/decode-caf/README.md +0 -55
  62. package/node_modules/@audio/decode-caf/decode-caf.d.ts +0 -16
  63. package/node_modules/@audio/decode-caf/decode-caf.js +0 -190
  64. package/node_modules/@audio/decode-caf/package.json +0 -43
  65. package/node_modules/@audio/decode-flac/LICENSE +0 -25
  66. package/node_modules/@audio/decode-flac/README.md +0 -23
  67. package/node_modules/@audio/decode-flac/decode-flac.d.ts +0 -16
  68. package/node_modules/@audio/decode-flac/decode-flac.js +0 -2994
  69. package/node_modules/@audio/decode-flac/meta.js +0 -115
  70. package/node_modules/@audio/decode-flac/package.json +0 -49
  71. package/node_modules/@audio/decode-mp3/LICENSE +0 -25
  72. package/node_modules/@audio/decode-mp3/README.md +0 -23
  73. package/node_modules/@audio/decode-mp3/decode-mp3.d.ts +0 -16
  74. package/node_modules/@audio/decode-mp3/decode-mp3.js +0 -868
  75. package/node_modules/@audio/decode-mp3/meta.js +0 -143
  76. package/node_modules/@audio/decode-mp3/package.json +0 -50
  77. package/node_modules/@audio/decode-opus/README.md +0 -23
  78. package/node_modules/@audio/decode-opus/decode-opus.d.ts +0 -16
  79. package/node_modules/@audio/decode-opus/decode-opus.js +0 -3179
  80. package/node_modules/@audio/decode-opus/package.json +0 -47
  81. package/node_modules/@audio/decode-qoa/LICENSE +0 -25
  82. package/node_modules/@audio/decode-qoa/README.md +0 -21
  83. package/node_modules/@audio/decode-qoa/decode-qoa.d.ts +0 -16
  84. package/node_modules/@audio/decode-qoa/decode-qoa.js +0 -278
  85. package/node_modules/@audio/decode-qoa/package.json +0 -46
  86. package/node_modules/@audio/decode-vorbis/LICENSE +0 -25
  87. package/node_modules/@audio/decode-vorbis/README.md +0 -23
  88. package/node_modules/@audio/decode-vorbis/decode-vorbis.d.ts +0 -16
  89. package/node_modules/@audio/decode-vorbis/decode-vorbis.js +0 -2984
  90. package/node_modules/@audio/decode-vorbis/package.json +0 -47
  91. package/node_modules/@audio/decode-wav/decode-wav.js +0 -104
  92. package/node_modules/@audio/decode-wav/meta.js +0 -114
  93. package/node_modules/@audio/decode-wav/package.json +0 -27
  94. package/node_modules/@audio/decode-webm/LICENSE +0 -21
  95. package/node_modules/@audio/decode-webm/README.md +0 -57
  96. package/node_modules/@audio/decode-webm/decode-webm.d.ts +0 -16
  97. package/node_modules/@audio/decode-webm/decode-webm.js +0 -3964
  98. package/node_modules/@audio/decode-webm/package.json +0 -51
  99. package/node_modules/@audio/decode-wma/LICENSE +0 -12
  100. package/node_modules/@audio/decode-wma/README.md +0 -76
  101. package/node_modules/@audio/decode-wma/decode-wma.d.ts +0 -33
  102. package/node_modules/@audio/decode-wma/decode-wma.js +0 -525
  103. package/node_modules/@audio/decode-wma/package.json +0 -47
  104. package/node_modules/@audio/decode-wma/src/wma.wasm.cjs +0 -0
  105. package/node_modules/audio-decode/.claude/settings.json +0 -204
  106. package/node_modules/audio-decode/.gitmodules +0 -9
  107. package/node_modules/audio-decode/meta.js +0 -11
  108. package/node_modules/audio-decode/stream.d.ts +0 -15
  109. package/node_modules/audio-decode/stream.js +0 -1
package/README.md ADDED
@@ -0,0 +1,11 @@
1
+ # OpenClaw WhatsApp
2
+
3
+ Official OpenClaw channel plugin for WhatsApp Web chats.
4
+
5
+ Install from OpenClaw:
6
+
7
+ ```bash
8
+ openclaw plugin add @openclaw/whatsapp
9
+ ```
10
+
11
+ Link a WhatsApp account through the plugin's setup flow, then configure which chats OpenClaw agents should monitor and reply to.
package/dist/api.js CHANGED
@@ -4,11 +4,11 @@ import { a as normalizeWhatsAppAllowFromEntries, c as normalizeWhatsAppTarget, i
4
4
  import { t as resolveWhatsAppOutboundTarget } from "./resolve-outbound-target-CcdugbDf.js";
5
5
  import "./send-DSlVXKL_.js";
6
6
  import { c as assertWebChannel, d as markdownToWhatsApp, f as resolveJidToE164, l as isSelfChatMode, m as toWhatsappJidWithLid, n as normalizeE164, p as toWhatsappJid, r as resolveUserPath, u as jidToE164 } from "./text-runtime-Dk37KYHj.js";
7
- import { n as WHATSAPP_LEGACY_OUTBOUND_SEND_DEP_KEYS, t as whatsappPlugin } from "./channel-DA2BAIo5.js";
7
+ import { n as WHATSAPP_LEGACY_OUTBOUND_SEND_DEP_KEYS, t as whatsappPlugin } from "./channel-DigzkmDO.js";
8
8
  import { t as whatsappCommandPolicy } from "./command-policy-BIOSHySD.js";
9
- import { a as resolveWhatsAppGroupRequireMention, o as resolveWhatsAppGroupToolPolicy, s as resolveWhatsAppGroupIntroHint } from "./setup-core-OvPMaAsx.js";
9
+ import { a as resolveWhatsAppGroupRequireMention, o as resolveWhatsAppGroupToolPolicy, s as resolveWhatsAppGroupIntroHint } from "./setup-core-D0ncRoh8.js";
10
10
  import "./config-schema-CROZuhT-.js";
11
- import { t as whatsappSetupPlugin } from "./channel.setup-DHXOo4h5.js";
11
+ import { t as whatsappSetupPlugin } from "./channel.setup-BRev7Qpj.js";
12
12
  import { t as DEFAULT_WEB_MEDIA_BYTES } from "./constants-HU41RHGI.js";
13
13
  import { n as listWhatsAppDirectoryGroupsFromConfig, r as listWhatsAppDirectoryPeersFromConfig } from "./directory-config-Dijefxc3.js";
14
14
  import { n as testing } from "./access-control-C53zKYSN.js";
@@ -105,18 +105,18 @@ async function startWhatsAppQaDriverSession(params) {
105
105
  async sendText(to, text) {
106
106
  return { messageId: (await sendApi.sendMessage(to, text)).messageId };
107
107
  },
108
- async waitForMessage(params) {
109
- const existing = observedMessages.find(params.match);
108
+ async waitForMessage(paramsLocal) {
109
+ const existing = observedMessages.find(paramsLocal.match);
110
110
  if (existing) return existing;
111
111
  return await new Promise((resolve, reject) => {
112
112
  const waiter = {
113
- predicate: params.match,
113
+ predicate: paramsLocal.match,
114
114
  resolve,
115
115
  reject,
116
116
  timeout: setTimeout(() => {
117
117
  removeWaiter(waiter);
118
118
  reject(/* @__PURE__ */ new Error("timed out waiting for WhatsApp QA driver message"));
119
- }, params.timeoutMs)
119
+ }, paramsLocal.timeoutMs)
120
120
  };
121
121
  waiters.push(waiter);
122
122
  });
@@ -9,7 +9,7 @@ import { p as toWhatsappJid } from "./text-runtime-Dk37KYHj.js";
9
9
  import { t as createWhatsAppLoginTool } from "./agent-tools-login-BX7eHgDm.js";
10
10
  import { i as lookupInboundMessageMetaForTarget } from "./quoted-message-CveINB35.js";
11
11
  import { t as whatsappCommandPolicy } from "./command-policy-BIOSHySD.js";
12
- import { a as resolveWhatsAppGroupRequireMention, c as resolveWhatsAppMentionStripRegexes, i as whatsappSetupWizardProxy, l as formatWhatsAppConfigAllowFromEntries, n as createWhatsAppPluginBase, o as resolveWhatsAppGroupToolPolicy, r as loadWhatsAppChannelRuntime, s as resolveWhatsAppGroupIntroHint, t as whatsappSetupAdapter } from "./setup-core-OvPMaAsx.js";
12
+ import { a as resolveWhatsAppGroupRequireMention, c as resolveWhatsAppMentionStripRegexes, i as whatsappSetupWizardProxy, l as formatWhatsAppConfigAllowFromEntries, n as createWhatsAppPluginBase, o as resolveWhatsAppGroupToolPolicy, r as loadWhatsAppChannelRuntime, s as resolveWhatsAppGroupIntroHint, t as whatsappSetupAdapter } from "./setup-core-D0ncRoh8.js";
13
13
  import { f as readWebAuthExistsForDecision, n as WHATSAPP_AUTH_UNSTABLE_CODE } from "./auth-store-CZ22aNcV.js";
14
14
  import { t as detectWhatsAppLegacyStateMigrations } from "./state-migrations-D_BmQUR9.js";
15
15
  import { createActionGate as createActionGate$1 } from "openclaw/plugin-sdk/channel-actions";
@@ -1,2 +1,2 @@
1
- import { t as whatsappPlugin } from "./channel-DA2BAIo5.js";
1
+ import { t as whatsappPlugin } from "./channel-DigzkmDO.js";
2
2
  export { whatsappPlugin };
@@ -1,9 +1,9 @@
1
1
  import { startWebLoginWithQr as startWebLoginWithQr$1, waitForWebLogin as waitForWebLogin$1 } from "./login-qr-runtime.js";
2
2
  import { c as logoutWeb$1, d as readWebAuthExistsBestEffort$1, f as readWebAuthExistsForDecision$1, g as readWebSelfId$1, h as readWebAuthState$1, m as readWebAuthSnapshotBestEffort$1, o as getWebAuthAgeMs$1, p as readWebAuthSnapshot$1, s as logWebSelfId$1, x as webAuthExists$1 } from "./auth-store-CZ22aNcV.js";
3
3
  import { t as getActiveWebListener$1 } from "./active-listener-CFwkn3ho.js";
4
- import { t as monitorWebChannel$1 } from "./monitor-BVRq04Dt.js";
4
+ import { t as monitorWebChannel$1 } from "./monitor-D-vg4gJF.js";
5
5
  import { t as loginWeb$1 } from "./login-2fuBM7Je.js";
6
- import { whatsappSetupWizard as whatsappSetupWizard$1 } from "./setup-surface-F-jVrH8u.js";
6
+ import { whatsappSetupWizard as whatsappSetupWizard$1 } from "./setup-surface-DLueEnfx.js";
7
7
  //#region extensions/whatsapp/src/channel.runtime.ts
8
8
  function getActiveWebListener(...args) {
9
9
  return getActiveWebListener$1(...args);
@@ -1,4 +1,4 @@
1
- import { a as resolveWhatsAppGroupRequireMention, i as whatsappSetupWizardProxy, n as createWhatsAppPluginBase, o as resolveWhatsAppGroupToolPolicy, s as resolveWhatsAppGroupIntroHint, t as whatsappSetupAdapter } from "./setup-core-OvPMaAsx.js";
1
+ import { a as resolveWhatsAppGroupRequireMention, i as whatsappSetupWizardProxy, n as createWhatsAppPluginBase, o as resolveWhatsAppGroupToolPolicy, s as resolveWhatsAppGroupIntroHint, t as whatsappSetupAdapter } from "./setup-core-D0ncRoh8.js";
2
2
  import { t as detectWhatsAppLegacyStateMigrations } from "./state-migrations-D_BmQUR9.js";
3
3
  //#region extensions/whatsapp/src/channel.setup.ts
4
4
  async function isWhatsAppAuthConfigured(account) {
@@ -5,12 +5,12 @@ function loadLoginQrModule() {
5
5
  return loginQrModulePromise;
6
6
  }
7
7
  async function startWebLoginWithQr(...args) {
8
- const { startWebLoginWithQr } = await loadLoginQrModule();
9
- return await startWebLoginWithQr(...args);
8
+ const { startWebLoginWithQr: startWebLoginWithQrLocal } = await loadLoginQrModule();
9
+ return await startWebLoginWithQrLocal(...args);
10
10
  }
11
11
  async function waitForWebLogin(...args) {
12
- const { waitForWebLogin } = await loadLoginQrModule();
13
- return await waitForWebLogin(...args);
12
+ const { waitForWebLogin: waitForWebLoginLocal } = await loadLoginQrModule();
13
+ return await waitForWebLoginLocal(...args);
14
14
  }
15
15
  //#endregion
16
16
  export { startWebLoginWithQr, waitForWebLogin };
@@ -766,12 +766,12 @@ async function attachWebInboxToSocket(options) {
766
766
  logWhatsAppVerbose(options.verbose, `Presence update failed: ${String(err)}`);
767
767
  }
768
768
  };
769
- const reply = async (text, options) => {
769
+ const reply = async (text, optionsResult) => {
770
770
  const resolved = await resolveOutboundMentionsForGroup(chatJid, text);
771
- return normalizeWhatsAppSendResult(await sendTrackedMessage(chatJid, addWhatsAppOutboundMentionsToContent({ text: resolved.text }, resolved.mentionedJids), options), "text");
771
+ return normalizeWhatsAppSendResult(await sendTrackedMessage(chatJid, addWhatsAppOutboundMentionsToContent({ text: resolved.text }, resolved.mentionedJids), optionsResult), "text");
772
772
  };
773
- const sendMedia = async (payload, options) => {
774
- return normalizeWhatsAppSendResult(await sendTrackedMessage(chatJid, await applyOutboundMentionsToContent(chatJid, await addWhatsAppImagePreviewFields(payload)), options), "media");
773
+ const sendMedia = async (payload, optionsValue) => {
774
+ return normalizeWhatsAppSendResult(await sendTrackedMessage(chatJid, await applyOutboundMentionsToContent(chatJid, await addWhatsAppImagePreviewFields(payload)), optionsValue), "media");
775
775
  };
776
776
  const timestamp = inbound.messageTimestampMs;
777
777
  const mentionedJids = extractMentionedJids(msg.message);
@@ -983,11 +983,11 @@ async function attachWebInboxToSocket(options) {
983
983
  },
984
984
  ...createWebSendApi({
985
985
  sock: {
986
- sendMessage: (jid, content, options) => sendTrackedMessage(jid, content, options),
987
- sendPresenceUpdate: async (presence, jid) => {
986
+ sendMessage: (jid, content, optionsLocal) => sendTrackedMessage(jid, content, optionsLocal),
987
+ sendPresenceUpdate: async (presenceLocal, jid) => {
988
988
  const currentSock = getCurrentSock();
989
989
  if (!currentSock) throw new Error(RECONNECT_IN_PROGRESS_ERROR);
990
- return currentSock.sendPresenceUpdate(presence, jid);
990
+ return currentSock.sendPresenceUpdate(presenceLocal, jid);
991
991
  }
992
992
  },
993
993
  defaultAccountId: options.accountId,
@@ -3235,7 +3235,7 @@ async function monitorWebChannel(verbose, listenerFactory = attachWebInboxToSock
3235
3235
  try {
3236
3236
  connection = await controller.openConnection({
3237
3237
  connectionId,
3238
- createListener: async ({ sock, connection }) => {
3238
+ createListener: async ({ sock, connection: connectionLocal }) => {
3239
3239
  const onMessage = createWebOnMessageHandler({
3240
3240
  cfg,
3241
3241
  loadConfig: loadCurrentMonitorConfig,
@@ -3246,7 +3246,7 @@ async function monitorWebChannel(verbose, listenerFactory = attachWebInboxToSock
3246
3246
  groupHistories,
3247
3247
  groupMemberNames,
3248
3248
  echoTracker,
3249
- backgroundTasks: connection.backgroundTasks,
3249
+ backgroundTasks: connectionLocal.backgroundTasks,
3250
3250
  replyResolver: activeReplyResolver,
3251
3251
  replyLogger,
3252
3252
  baseMentionConfig,
@@ -10,7 +10,7 @@ import { t as DEFAULT_WEB_MEDIA_BYTES } from "./constants-HU41RHGI.js";
10
10
  import { d as extractLocationData, f as extractMediaPlaceholder, l as extractContactContext, m as extractText } from "./send-api-Bjn-h80j.js";
11
11
  import { n as newConnectionId, r as waitForWaConnection, t as createWaSocket } from "./session-DyGWNClj.js";
12
12
  import { n as resolveWebAccountId, t as getActiveWebListener } from "./active-listener-CFwkn3ho.js";
13
- import { a as loadWebMediaRaw, c as monitorWebInbox, i as loadWebMedia, l as resetWebInboundDedupe, n as LocalMediaAccessError, o as optimizeImageToJpeg, r as getDefaultLocalRoots, s as optimizeImageToPng, t as monitorWebChannel } from "./monitor-BVRq04Dt.js";
13
+ import { a as loadWebMediaRaw, c as monitorWebInbox, i as loadWebMedia, l as resetWebInboundDedupe, n as LocalMediaAccessError, o as optimizeImageToJpeg, r as getDefaultLocalRoots, s as optimizeImageToPng, t as monitorWebChannel } from "./monitor-D-vg4gJF.js";
14
14
  import { t as loginWeb } from "./login-2fuBM7Je.js";
15
15
  import { HEARTBEAT_PROMPT, HEARTBEAT_TOKEN, SILENT_REPLY_TOKEN, stripHeartbeatToken } from "openclaw/plugin-sdk/reply-runtime";
16
16
  export { DEFAULT_WEB_MEDIA_BYTES, HEARTBEAT_PROMPT, HEARTBEAT_TOKEN, LocalMediaAccessError, SILENT_REPLY_TOKEN, WA_WEB_AUTH_DIR, WHATSAPP_AUTH_UNSTABLE_CODE, WhatsAppAuthUnstableError, createWaSocket, createWhatsAppLoginTool, extractContactContext, extractLocationData, extractMediaPlaceholder, extractText, formatError, formatWhatsAppWebAuthStatusState, getActiveWebListener, getDefaultLocalRoots, getStatusCode, getWebAuthAgeMs, handleWhatsAppAction, hasWebCredsSync, loadWebMedia, loadWebMediaRaw, logWebSelfId, loginWeb, logoutWeb, monitorWebChannel, monitorWebInbox, newConnectionId, optimizeImageToJpeg, optimizeImageToPng, pickWebChannel, readCredsJsonRaw, readWebAuthExistsBestEffort, readWebAuthExistsForDecision, readWebAuthSnapshot, readWebAuthSnapshotBestEffort, readWebAuthState, readWebSelfId, readWebSelfIdentity, readWebSelfIdentityForDecision, resetWebInboundDedupe, resolveDefaultWebAuthDir, resolveWebAccountId, resolveWebCredsBackupPath, resolveWebCredsPath, restoreCredsFromBackupIfNeeded, sendMessageWhatsApp, sendPollWhatsApp, sendReactionWhatsApp, sendTypingWhatsApp, setWhatsAppRuntime, startWebLoginWithQr, stripHeartbeatToken, waitForCredsSaveQueue, waitForCredsSaveQueueWithTimeout, waitForWaConnection, waitForWebLogin, webAuthExists, whatsAppActionRuntime, writeCredsJsonAtomically };
@@ -99,10 +99,10 @@ async function applyWhatsAppSecurityConfigFixes(params) {
99
99
  //#region extensions/whatsapp/src/shared.ts
100
100
  const WHATSAPP_CHANNEL = "whatsapp";
101
101
  async function loadWhatsAppChannelRuntime() {
102
- return await import("./channel.runtime-Q1LZDB5s.js");
102
+ return await import("./channel.runtime-BzDa8nVv.js");
103
103
  }
104
104
  async function loadWhatsAppSetupSurface() {
105
- return await import("./setup-surface-F-jVrH8u.js");
105
+ return await import("./setup-surface-DLueEnfx.js");
106
106
  }
107
107
  const whatsappSetupWizardProxy = createWhatsAppSetupWizardProxy(async () => (await loadWhatsAppSetupSurface()).whatsappSetupWizard);
108
108
  const whatsappConfigAdapter = createScopedChannelConfigAdapter({
@@ -265,9 +265,9 @@ function createWhatsAppPluginBase(params) {
265
265
  deriveLegacySessionChatType,
266
266
  resolveLegacyGroupSessionKey,
267
267
  isLegacyGroupSessionKey,
268
- canonicalizeLegacySessionKey: (params) => canonicalizeLegacySessionKey({
269
- key: params.key,
270
- agentId: params.agentId
268
+ canonicalizeLegacySessionKey: (paramsLocal) => canonicalizeLegacySessionKey({
269
+ key: paramsLocal.key,
270
+ agentId: paramsLocal.agentId
271
271
  })
272
272
  },
273
273
  secrets: {
@@ -2,7 +2,7 @@ import { r as resolveDefaultWhatsAppAccountId } from "./account-ids-CB5SOWjc.js"
2
2
  import { r as hasWebCredsSync } from "./creds-files-B1kSWtBg.js";
3
3
  import { a as resolveWhatsAppAccount, o as resolveWhatsAppAuthDir } from "./accounts-DgViSyJx.js";
4
4
  import { a as normalizeWhatsAppAllowFromEntries, o as normalizeWhatsAppAllowFromEntry } from "./normalize-target-bVWjgftN.js";
5
- import { t as whatsappSetupAdapter } from "./setup-core-OvPMaAsx.js";
5
+ import { t as whatsappSetupAdapter } from "./setup-core-D0ncRoh8.js";
6
6
  import { DEFAULT_ACCOUNT_ID, createSetupTranslator, splitSetupEntries } from "openclaw/plugin-sdk/setup";
7
7
  import { formatCliCommand, formatDocsLink } from "openclaw/plugin-sdk/setup-tools";
8
8
  //#region extensions/whatsapp/src/setup-finalize.ts
@@ -1,2 +1,2 @@
1
- import { t as whatsappSetupPlugin } from "./channel.setup-DHXOo4h5.js";
1
+ import { t as whatsappSetupPlugin } from "./channel.setup-BRev7Qpj.js";
2
2
  export { whatsappSetupPlugin };
@@ -36,7 +36,7 @@ const whatsappSetupWizard = {
36
36
  },
37
37
  resolveShouldPromptAccountIds: ({ shouldPromptAccountIds }) => shouldPromptAccountIds,
38
38
  credentials: [],
39
- finalize: async (params) => await (await import("./setup-finalize-Dk23pfKc.js")).finalizeWhatsAppSetup(params),
39
+ finalize: async (params) => await (await import("./setup-finalize-BdztDwTy.js")).finalizeWhatsAppSetup(params),
40
40
  disable: (cfg) => setSetupChannelEnabled(cfg, channel, false),
41
41
  onAccountRecorded: (accountId, options) => {
42
42
  options?.onAccountId?.(channel, accountId);
@@ -0,0 +1,44 @@
1
+ {
2
+ "env": {
3
+ "browser": true,
4
+ "node": true,
5
+ "commonjs": true,
6
+ "es6": true
7
+ },
8
+ "extends": "eslint:recommended",
9
+ "rules": {
10
+ "strict": 2,
11
+ "indent": 0,
12
+ "linebreak-style": 0,
13
+ "quotes": 0,
14
+ "semi": 0,
15
+ "no-cond-assign": 1,
16
+ "no-constant-condition": 1,
17
+ "no-duplicate-case": 1,
18
+ "no-empty": 1,
19
+ "no-ex-assign": 1,
20
+ "no-extra-boolean-cast": 1,
21
+ "no-extra-semi": 1,
22
+ "no-fallthrough": 1,
23
+ "no-func-assign": 1,
24
+ "no-global-assign": 1,
25
+ "no-implicit-globals": 2,
26
+ "no-inner-declarations": ["error", "functions"],
27
+ "no-irregular-whitespace": 2,
28
+ "no-loop-func": 1,
29
+ "no-magic-numbers": ["warn", { "ignore": [1, 0, -1], "ignoreArrayIndexes": true}],
30
+ "no-multi-str": 1,
31
+ "no-mixed-spaces-and-tabs": 1,
32
+ "no-proto": 1,
33
+ "no-sequences": 1,
34
+ "no-throw-literal": 1,
35
+ "no-unmodified-loop-condition": 1,
36
+ "no-useless-call": 1,
37
+ "no-void": 1,
38
+ "no-with": 2,
39
+ "wrap-iife": 1,
40
+ "no-redeclare": 1,
41
+ "no-unused-vars": ["error", { "vars": "all", "args": "none" }],
42
+ "no-sparse-arrays": 1
43
+ }
44
+ }
@@ -0,0 +1,31 @@
1
+ # This workflow will do a clean installation of node dependencies, cache/restore them, build the source code and run tests across different versions of node
2
+ # For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-nodejs
3
+
4
+ name: Test
5
+
6
+ on:
7
+ push:
8
+ branches: [ "master" ]
9
+ pull_request:
10
+ branches: [ "master" ]
11
+
12
+ jobs:
13
+ build:
14
+
15
+ runs-on: ubuntu-latest
16
+
17
+ strategy:
18
+ matrix:
19
+ node-version: [14.x, 16.x, 18.x]
20
+ # See supported Node.js release schedule at https://nodejs.org/en/about/releases/
21
+
22
+ steps:
23
+ - uses: actions/checkout@v3
24
+ - name: Use Node.js ${{ matrix.node-version }}
25
+ uses: actions/setup-node@v3
26
+ with:
27
+ node-version: ${{ matrix.node-version }}
28
+ cache: 'npm'
29
+ - run: npm ci
30
+ - run: npm run build --if-present
31
+ - run: npm test
@@ -0,0 +1,7 @@
1
+ sudo: false
2
+ language: node_js
3
+ node_js:
4
+ - 'node'
5
+ - '6'
6
+ - '5'
7
+ - '4'
@@ -1,10 +1,6 @@
1
- This work is offered to Krishna (https://github.com/krishnized/license).
2
-
3
- ---
4
-
5
1
  The MIT License (MIT)
2
+ Copyright (c) 2018 Dmitry Yvanov <df.creative@gmail.com>
6
3
 
7
- Copyright (c) 2025 audiojs
8
4
 
9
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
10
6
  of this software and associated documentation files (the "Software"), to deal
@@ -23,3 +19,4 @@ IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
23
19
  DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
24
20
  OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE
25
21
  OR OTHER DEALINGS IN THE SOFTWARE.
22
+
@@ -0,0 +1,76 @@
1
+ /**
2
+ * AudioBuffer class
3
+ */
4
+ export default class AudioBuffer {
5
+ /**
6
+ * Create AudioBuffer instance.
7
+ * @constructor
8
+ * @param {Object} options - buffer init options.
9
+ * @param {number} options.length - buffer length in samples.
10
+ * @param {number} options.sampleRate - buffer sample rate.
11
+ * @param {number} options.numberOfChannels - number of channels.
12
+ */
13
+ constructor(options) {
14
+ if (!options) throw TypeError('options argument is required')
15
+ if (!options.sampleRate) throw TypeError('options.sampleRate is required')
16
+ if (options.sampleRate < 3000 || options.sampleRate > 768000) throw TypeError('options.sampleRate must be within 3000..768000')
17
+ if (!options.length) throw TypeError('options.length must be more than 0')
18
+
19
+ this.sampleRate = options.sampleRate
20
+ this.numberOfChannels = options.numberOfChannels || 1
21
+ this.length = options.length | 0
22
+ this.duration = this.length / this.sampleRate
23
+
24
+ //data is stored as a planar sequence
25
+ this._data = new Float32Array(this.length * this.numberOfChannels)
26
+
27
+ //channels data is cached as subarrays
28
+ this._channelData = []
29
+ for (let c = 0; c < this.numberOfChannels; c++) {
30
+ this._channelData.push(this._data.subarray(c * this.length, (c+1) * this.length))
31
+ }
32
+ }
33
+
34
+ /**
35
+ * Return data associated with the channel.
36
+ * @param {number} channel - Channel index, starting from 0.
37
+ * @return {Float32Array} Array containing the data.
38
+ */
39
+ getChannelData (channel) {
40
+ if (channel >= this.numberOfChannels || channel < 0 || channel == null) throw Error('Cannot getChannelData: channel number (' + channel + ') exceeds number of channels (' + this.numberOfChannels + ')');
41
+
42
+ return this._channelData[channel]
43
+ }
44
+
45
+
46
+ /**
47
+ * Place data to the destination buffer, starting from the position.
48
+ * @param {Float32Array} destination - Destination array to write data to.
49
+ * @param {number} channelNumber - Channel to take data from.
50
+ * @param {number} startInChannel - Data offset in channel to read from.
51
+ */
52
+ copyFromChannel (destination, channelNumber, startInChannel) {
53
+ if (startInChannel == null) startInChannel = 0;
54
+ var data = this._channelData[channelNumber]
55
+ for (var i = startInChannel, j = 0; i < this.length && j < destination.length; i++, j++) {
56
+ destination[j] = data[i];
57
+ }
58
+ }
59
+
60
+
61
+ /**
62
+ * Place data from the source to the channel, starting (in self) from the position.
63
+ * @param {Float32Array | Array} source - source array to read data from.
64
+ * @param {number} channelNumber - channel index to copy data to.
65
+ * @param {number} startInChannel - offset in channel to copy data to.
66
+ */
67
+ copyToChannel (source, channelNumber, startInChannel) {
68
+ var data = this._channelData[channelNumber]
69
+
70
+ if (!startInChannel) startInChannel = 0;
71
+
72
+ for (var i = startInChannel, j = 0; i < this.length && j < source.length; i++, j++) {
73
+ data[i] = source[j];
74
+ }
75
+ }
76
+ }
@@ -0,0 +1,37 @@
1
+ {
2
+ "name": "audio-buffer",
3
+ "version": "5.0.0",
4
+ "description": "AudioBuffer class for node/browser",
5
+ "main": "index.js",
6
+ "type": "module",
7
+ "repository": {
8
+ "type": "git",
9
+ "url": "https://github.com/audiojs/audio-buffer"
10
+ },
11
+ "scripts": {
12
+ "test": "node test"
13
+ },
14
+ "keywords": [
15
+ "audio",
16
+ "audiojs",
17
+ "pcm",
18
+ "dsp",
19
+ "sound",
20
+ "processing",
21
+ "ndsamples",
22
+ "ponyfill",
23
+ "audio-buffer",
24
+ "web-audio",
25
+ "waa",
26
+ "audiodata"
27
+ ],
28
+ "author": "Dmitry Iv <df.creative@gmail.com>",
29
+ "license": "MIT",
30
+ "bugs": {
31
+ "url": "https://github.com/audiojs/audio-buffer/issues"
32
+ },
33
+ "homepage": "https://github.com/audiojs/audio-buffer",
34
+ "devDependencies": {
35
+ "tape": "^5.6.3"
36
+ }
37
+ }
@@ -0,0 +1,56 @@
1
+ # audio-buffer [![test](https://github.com/audiojs/audio-buffer/actions/workflows/node.js.yml/badge.svg)](https://github.com/audiojs/audio-buffer/actions/workflows/node.js.yml) [![stable](https://img.shields.io/badge/stability-stable-brightgreen.svg)](http://github.com/badges/stability-badges)
2
+
3
+ _AudioBuffer_ - basic audio data container class.
4
+ Useful instead of _Buffer_ in audio streams, [**@audiojs**](https://github.com/audiojs) components, in webworkers, nodejs, other environments without audio context.
5
+
6
+ Implementation is compatible with [Web Audio API AudioBuffer](https://developer.mozilla.org/en-US/docs/Web/API/AudioBuffer), can be used as ponyfill.
7
+
8
+ ## Usage
9
+
10
+ [![npm install audio-buffer](https://nodei.co/npm/audio-buffer.png?mini=true)](https://npmjs.org/package/audio-buffer/)
11
+
12
+ ### new AudioBuffer(options)
13
+
14
+ Create audio buffer from `options`.
15
+
16
+ * `options.length` — number of samples, minimum is 1.
17
+ * `options.sampleRate` — default sample rate is 44100.
18
+ * `options.numberOfChannels` — default number of channels is 1.
19
+
20
+ ### buffer.duration
21
+
22
+ Duration of the underlying audio data, in seconds.
23
+
24
+ ### buffer.length
25
+
26
+ Number of samples per channel.
27
+
28
+ ### buffer.sampleRate
29
+
30
+ Default sample rate is 44100.
31
+
32
+ ### buffer.numberOfChannels
33
+
34
+ Default number of channels is 1.
35
+
36
+ ### buffer.getChannelData(channel)
37
+
38
+ Get array containing the data for the channel (not copied).
39
+
40
+ ### buffer.copyFromChannel(destination, channelNumber, startInChannel=0)
41
+
42
+ Place data from channel to destination Float32Array.
43
+
44
+ ### buffer.copyToChannel(source, channelNumber, startInChannel=0)
45
+
46
+ Place data from source Float32Array to the channel.
47
+
48
+
49
+ ## Similar
50
+
51
+ * [ndsamples](https://github.com/livejs/ndsamples) — audio-wrapper for ndarrays. A somewhat alternative approach to wrap audio data, based on ndarrays, used by some modules in [livejs](https://github.com/livejs).
52
+ * [1](https://www.npmjs.com/package/audiobuffer), [2](https://www.npmjs.com/package/audio-buffer), [3](https://github.com/sebpiq/node-web-audio-api/blob/master/lib/AudioBuffer.js), [4](https://developer.mozilla.org/en-US/docs/Web/API/AudioBuffer) — other AudioBuffer implementations.
53
+ * [audiodata](https://www.npmjs.com/package/audiodata) alternative data holder from @mohayonao.
54
+
55
+
56
+ <p align=center><a href="https://github.com/krishnized/license/">🕉</a></p>
@@ -0,0 +1,43 @@
1
+ {
2
+ "env": {
3
+ "browser": true,
4
+ "node": true,
5
+ "commonjs": true,
6
+ "es6": true
7
+ },
8
+ "extends": "eslint:recommended",
9
+ "rules": {
10
+ "strict": 2,
11
+ "indent": 0,
12
+ "linebreak-style": 0,
13
+ "quotes": 0,
14
+ "semi": 0,
15
+ "no-cond-assign": 1,
16
+ "no-constant-condition": 1,
17
+ "no-duplicate-case": 1,
18
+ "no-empty": 1,
19
+ "no-ex-assign": 1,
20
+ "no-extra-boolean-cast": 1,
21
+ "no-extra-semi": 1,
22
+ "no-fallthrough": 1,
23
+ "no-func-assign": 1,
24
+ "no-global-assign": 1,
25
+ "no-implicit-globals": 2,
26
+ "no-inner-declarations": ["error", "functions"],
27
+ "no-irregular-whitespace": 2,
28
+ "no-loop-func": 1,
29
+ "no-multi-str": 1,
30
+ "no-mixed-spaces-and-tabs": 1,
31
+ "no-proto": 1,
32
+ "no-sequences": 1,
33
+ "no-throw-literal": 1,
34
+ "no-unmodified-loop-condition": 1,
35
+ "no-useless-call": 1,
36
+ "no-void": 1,
37
+ "no-with": 2,
38
+ "wrap-iife": 1,
39
+ "no-redeclare": 1,
40
+ "no-unused-vars": ["error", { "vars": "all", "args": "none" }],
41
+ "no-sparse-arrays": 1
42
+ }
43
+ }
@@ -1,22 +1,31 @@
1
+ # This workflow will do a clean installation of node dependencies, cache/restore them, build the source code and run tests across different versions of node
2
+ # For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-nodejs
3
+
1
4
  name: test
2
5
 
3
6
  on:
4
7
  push:
5
- branches: [master]
8
+ branches: [ "master" ]
6
9
  pull_request:
7
- branches: [master]
10
+ branches: [ "master" ]
8
11
 
9
12
  jobs:
10
- test:
13
+ build:
14
+
11
15
  runs-on: ubuntu-latest
16
+
12
17
  strategy:
13
18
  matrix:
14
- node-version: [20.x, 22.x]
19
+ node-version: [14.x, 16.x, 18.x]
20
+ # See supported Node.js release schedule at https://nodejs.org/en/about/releases/
21
+
15
22
  steps:
16
- - uses: actions/checkout@v4
17
- - uses: actions/setup-node@v4
18
- with:
19
- node-version: ${{ matrix.node-version }}
20
- cache: npm
21
- - run: npm ci
22
- - run: npm test
23
+ - uses: actions/checkout@v3
24
+ - name: Use Node.js ${{ matrix.node-version }}
25
+ uses: actions/setup-node@v3
26
+ with:
27
+ node-version: ${{ matrix.node-version }}
28
+ cache: 'npm'
29
+ - run: npm ci
30
+ - run: npm run build --if-present
31
+ - run: npm test
@@ -0,0 +1,13 @@
1
+ sudo: false
2
+ language: node_js
3
+ node_js:
4
+ - 'node'
5
+ - '6'
6
+ - '5'
7
+ - '4'
8
+ matrix:
9
+ fast_finish: true
10
+ allow_failures:
11
+ - node_js: "4"
12
+ - node_js: "5"
13
+