@openclaw/whatsapp 2026.5.7 → 2026.5.9-beta.1

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 (37) hide show
  1. package/dist/action-runtime-api.js +1 -1
  2. package/dist/{action-runtime-BqYZmBX_.js → action-runtime-flTHnBac.js} +1 -1
  3. package/dist/action-runtime.runtime.js +1 -1
  4. package/dist/api.js +115 -7
  5. package/dist/{auth-store-BNZmNP-s.js → auth-store-CG0eSZ0D.js} +17 -39
  6. package/dist/{channel-CTr3YjO8.js → channel-Dnv-QeNE.js} +34 -7
  7. package/dist/channel-plugin-api.js +1 -1
  8. package/dist/{channel-react-action-BuSTzmDX.js → channel-react-action-LOuxBqX6.js} +1 -1
  9. package/dist/{channel.runtime-C3i9Svfj.js → channel.runtime-CCZpOzbU.js} +5 -5
  10. package/dist/{channel.setup-BYtkDwHe.js → channel.setup-CV0OjAwl.js} +3 -3
  11. package/dist/{connection-controller-BCIuChXD.js → connection-controller-d8D2iUBj.js} +6 -197
  12. package/dist/contract-api.js +1 -1
  13. package/dist/legacy-state-migrations-api.js +1 -1
  14. package/dist/light-runtime-api.js +2 -2
  15. package/dist/{login-DSUTCcJ7.js → login-B_u009k0.js} +3 -2
  16. package/dist/{login-qr-dfs8tfGo.js → login-qr-C0b7I7hu.js} +3 -2
  17. package/dist/login-qr-runtime.js +1 -1
  18. package/dist/{monitor-C5_C_RGJ.js → monitor-5u0dVXnB.js} +93 -683
  19. package/dist/{outbound-adapter-CbR17Ehj.js → outbound-adapter-BoHBD2S7.js} +3 -3
  20. package/dist/{outbound-base-BmzhutvF.js → outbound-base-CCx7atwc.js} +6 -1
  21. package/dist/{outbound-media-contract-BPdOq7Hb.js → outbound-media-contract-Dzi1ILTd.js} +36 -40
  22. package/dist/outbound-payload-test-api.js +1 -1
  23. package/dist/runtime-api.js +8 -7
  24. package/dist/{send-CxctcFGT.js → send-CLBN7TZv.js} +1 -1
  25. package/dist/send-api-DoycpOvC.js +697 -0
  26. package/dist/session-BXC3R43P.js +198 -0
  27. package/dist/setup-plugin-api.js +1 -1
  28. package/dist/{setup-surface-CF3l3gEZ.js → setup-surface-RbOpXjSR.js} +2 -2
  29. package/dist/{shared-CTSTwprn.js → shared-h4cwNeYT.js} +2 -2
  30. package/dist/{state-migrations-DnCdvoYD.js → state-migrations-Bm0S67yH.js} +2 -1
  31. package/dist/test-api.js +1 -1
  32. package/package.json +5 -5
  33. package/dist/{access-control-CTj7P7WP.js → access-control-hFVqAWSd.js} +1 -1
  34. /package/dist/{active-listener-N7GFKsuN.js → active-listener-DTbKS-j-.js} +0 -0
  35. /package/dist/{audio-preflight.runtime-Bcdsl_ri.js → audio-preflight.runtime-MmkB-pgX.js} +0 -0
  36. /package/dist/{reply-resolver.runtime-BRCgoO4C.js → reply-resolver.runtime-rIVWohXr.js} +0 -0
  37. /package/dist/{session.runtime-C1eSE_KK.js → session.runtime-CVhtXjTk.js} +0 -0
@@ -1,12 +1,12 @@
1
1
  import { t as resolveWhatsAppOutboundTarget } from "./resolve-outbound-target-CQ3Y1i0g.js";
2
- import { n as normalizeWhatsAppPayloadText } from "./outbound-media-contract-BPdOq7Hb.js";
3
- import { t as createWhatsAppOutboundBase } from "./outbound-base-BmzhutvF.js";
2
+ import { n as normalizeWhatsAppPayloadText } from "./outbound-media-contract-Dzi1ILTd.js";
3
+ import { t as createWhatsAppOutboundBase } from "./outbound-base-CCx7atwc.js";
4
4
  import { shouldLogVerbose } from "openclaw/plugin-sdk/runtime-env";
5
5
  import { chunkText } from "openclaw/plugin-sdk/reply-chunking";
6
6
  //#region extensions/whatsapp/src/outbound-adapter.ts
7
7
  let whatsAppSendModulePromise;
8
8
  function loadWhatsAppSendModule() {
9
- whatsAppSendModulePromise ??= import("./send-CxctcFGT.js").then((n) => n.a);
9
+ whatsAppSendModulePromise ??= import("./send-CLBN7TZv.js").then((n) => n.a);
10
10
  return whatsAppSendModulePromise;
11
11
  }
12
12
  function normalizeOutboundText(text) {
@@ -1,5 +1,5 @@
1
1
  import { s as toWhatsappJid } from "./text-runtime-DFFwk5z6.js";
2
- import { n as normalizeWhatsAppPayloadText, t as normalizeWhatsAppOutboundPayload } from "./outbound-media-contract-BPdOq7Hb.js";
2
+ import { n as normalizeWhatsAppPayloadText, t as normalizeWhatsAppOutboundPayload } from "./outbound-media-contract-Dzi1ILTd.js";
3
3
  import { i as lookupInboundMessageMetaForTarget } from "./quoted-message-BXs55Teh.js";
4
4
  import { DEFAULT_ACCOUNT_ID, listCombinedAccountIds, normalizeOptionalAccountId, resolveListedDefaultAccountId } from "openclaw/plugin-sdk/account-core";
5
5
  import { createAttachedChannelResultAdapter } from "openclaw/plugin-sdk/channel-send-result";
@@ -41,6 +41,11 @@ function createWhatsAppOutboundBase({ chunker, sendMessageWhatsApp, sendPollWhat
41
41
  chunkerMode: "text",
42
42
  textChunkLimit: 4e3,
43
43
  sanitizeText: ({ text }) => normalizeText(text),
44
+ deliveryCapabilities: { durableFinal: {
45
+ text: true,
46
+ replyTo: true,
47
+ messageSendingHooks: true
48
+ } },
44
49
  pollMaxOptions: 12,
45
50
  resolveTarget,
46
51
  ...createAttachedChannelResultAdapter({
@@ -1,10 +1,10 @@
1
1
  import { t as formatError } from "./session-errors-CSuKZPub.js";
2
2
  import { t as text_runtime_exports } from "./text-runtime-DFFwk5z6.js";
3
3
  import path from "node:path";
4
- import fs from "node:fs/promises";
5
4
  import { MEDIA_FFMPEG_MAX_AUDIO_DURATION_SECS, runFfmpeg } from "openclaw/plugin-sdk/media-runtime";
6
5
  import { sanitizeForPlainText } from "openclaw/plugin-sdk/outbound-runtime";
7
- import { resolvePreferredOpenClawTmpDir } from "openclaw/plugin-sdk/temp-path";
6
+ import { writeExternalFileWithinRoot } from "openclaw/plugin-sdk/security-runtime";
7
+ import { resolvePreferredOpenClawTmpDir, withTempWorkspace } from "openclaw/plugin-sdk/temp-path";
8
8
  //#region extensions/whatsapp/src/outbound-media-contract.ts
9
9
  const WHATSAPP_VOICE_FILE_NAME = "voice.ogg";
10
10
  const WHATSAPP_VOICE_SAMPLE_RATE_HZ = 48e3;
@@ -82,47 +82,43 @@ function isWhatsAppNativeVoiceAudio(params) {
82
82
  return ext === ".ogg" || ext === ".opus";
83
83
  }
84
84
  async function transcodeToWhatsAppVoiceOpus(params) {
85
- const tempRoot = resolvePreferredOpenClawTmpDir();
86
- await fs.mkdir(tempRoot, {
87
- recursive: true,
88
- mode: 448
89
- });
90
- const tempDir = await fs.mkdtemp(path.join(tempRoot, "whatsapp-voice-"));
91
- try {
85
+ return await withTempWorkspace({
86
+ rootDir: resolvePreferredOpenClawTmpDir(),
87
+ prefix: "whatsapp-voice-"
88
+ }, async (workspace) => {
92
89
  const ext = path.extname(params.fileName).toLowerCase();
93
90
  const inputExt = ext && ext.length <= 12 ? ext : ".audio";
94
- const inputPath = path.join(tempDir, `input${inputExt}`);
95
- const outputPath = path.join(tempDir, WHATSAPP_VOICE_FILE_NAME);
96
- await fs.writeFile(inputPath, params.buffer, { mode: 384 });
97
- await runFfmpeg([
98
- "-hide_banner",
99
- "-loglevel",
100
- "error",
101
- "-y",
102
- "-i",
103
- inputPath,
104
- "-vn",
105
- "-sn",
106
- "-dn",
107
- "-t",
108
- String(MEDIA_FFMPEG_MAX_AUDIO_DURATION_SECS),
109
- "-ar",
110
- String(WHATSAPP_VOICE_SAMPLE_RATE_HZ),
111
- "-ac",
112
- "1",
113
- "-c:a",
114
- "libopus",
115
- "-b:a",
116
- WHATSAPP_VOICE_BITRATE,
117
- outputPath
118
- ]);
119
- return await fs.readFile(outputPath);
120
- } finally {
121
- await fs.rm(tempDir, {
122
- recursive: true,
123
- force: true
91
+ const inputPath = await workspace.write(`input${inputExt}`, params.buffer);
92
+ await writeExternalFileWithinRoot({
93
+ rootDir: workspace.dir,
94
+ path: WHATSAPP_VOICE_FILE_NAME,
95
+ write: async (outputPath) => {
96
+ await runFfmpeg([
97
+ "-hide_banner",
98
+ "-loglevel",
99
+ "error",
100
+ "-y",
101
+ "-i",
102
+ inputPath,
103
+ "-vn",
104
+ "-sn",
105
+ "-dn",
106
+ "-t",
107
+ String(MEDIA_FFMPEG_MAX_AUDIO_DURATION_SECS),
108
+ "-ar",
109
+ String(WHATSAPP_VOICE_SAMPLE_RATE_HZ),
110
+ "-ac",
111
+ "1",
112
+ "-c:a",
113
+ "libopus",
114
+ "-b:a",
115
+ WHATSAPP_VOICE_BITRATE,
116
+ outputPath
117
+ ]);
118
+ }
124
119
  });
125
- }
120
+ return await workspace.read(WHATSAPP_VOICE_FILE_NAME);
121
+ });
126
122
  }
127
123
  function deriveWhatsAppDocumentFileName(mediaUrl) {
128
124
  if (!mediaUrl) return;
@@ -1,2 +1,2 @@
1
- import { t as whatsappOutbound } from "./outbound-adapter-CbR17Ehj.js";
1
+ import { t as whatsappOutbound } from "./outbound-adapter-BoHBD2S7.js";
2
2
  export { whatsappOutbound };
@@ -1,15 +1,16 @@
1
1
  import { n as resolveWebCredsBackupPath, r as resolveWebCredsPath, t as hasWebCredsSync } from "./creds-files-_2V8jzQa.js";
2
- import { n as whatsAppActionRuntime, t as handleWhatsAppAction } from "./action-runtime-BqYZmBX_.js";
2
+ import { n as whatsAppActionRuntime, t as handleWhatsAppAction } from "./action-runtime-flTHnBac.js";
3
3
  import { n as getStatusCode, t as formatError } from "./session-errors-CSuKZPub.js";
4
- import { i as sendTypingWhatsApp, n as sendPollWhatsApp, r as sendReactionWhatsApp, t as sendMessageWhatsApp } from "./send-CxctcFGT.js";
4
+ import { i as sendTypingWhatsApp, n as sendPollWhatsApp, r as sendReactionWhatsApp, t as sendMessageWhatsApp } from "./send-CLBN7TZv.js";
5
5
  import { startWebLoginWithQr, waitForWebLogin } from "./login-qr-runtime.js";
6
6
  import { t as createWhatsAppLoginTool } from "./agent-tools-login-DpRxLNRB.js";
7
7
  import { n as setWhatsAppRuntime } from "./runtime-6fZ67abR.js";
8
- import { C as waitForCredsSaveQueueWithTimeout, S as waitForCredsSaveQueue, _ as readWebSelfIdentityForDecision, a as getWebAuthAgeMs, b as webAuthExists, c as pickWebChannel, d as readWebAuthExistsForDecision, f as readWebAuthSnapshot, g as readWebSelfIdentity, h as readWebSelfId, i as formatWhatsAppWebAuthStatusState, l as readCredsJsonRaw, m as readWebAuthState, n as WHATSAPP_AUTH_UNSTABLE_CODE, o as logWebSelfId, p as readWebAuthSnapshotBestEffort, r as WhatsAppAuthUnstableError, s as logoutWeb, t as WA_WEB_AUTH_DIR, u as readWebAuthExistsBestEffort, v as resolveDefaultWebAuthDir, w as writeCredsJsonAtomically, y as restoreCredsFromBackupIfNeeded } from "./auth-store-BNZmNP-s.js";
8
+ import { C as waitForCredsSaveQueueWithTimeout, S as waitForCredsSaveQueue, _ as readWebSelfIdentityForDecision, a as getWebAuthAgeMs, b as webAuthExists, c as pickWebChannel, d as readWebAuthExistsForDecision, f as readWebAuthSnapshot, g as readWebSelfIdentity, h as readWebSelfId, i as formatWhatsAppWebAuthStatusState, l as readCredsJsonRaw, m as readWebAuthState, n as WHATSAPP_AUTH_UNSTABLE_CODE, o as logWebSelfId, p as readWebAuthSnapshotBestEffort, r as WhatsAppAuthUnstableError, s as logoutWeb, t as WA_WEB_AUTH_DIR, u as readWebAuthExistsBestEffort, v as resolveDefaultWebAuthDir, w as writeCredsJsonAtomically, y as restoreCredsFromBackupIfNeeded } from "./auth-store-CG0eSZ0D.js";
9
9
  import { t as DEFAULT_WEB_MEDIA_BYTES } from "./constants-DLGCIbfl.js";
10
- import { n as resolveWebAccountId, t as getActiveWebListener } from "./active-listener-N7GFKsuN.js";
11
- import { c as waitForWaConnection, o as createWaSocket, s as newConnectionId } from "./connection-controller-BCIuChXD.js";
12
- import { a as loadWebMediaRaw, c as monitorWebInbox, d as extractMediaPlaceholder, f as extractText, i as loadWebMedia, l as extractContactContext, n as LocalMediaAccessError, o as optimizeImageToJpeg, p as resetWebInboundDedupe, r as getDefaultLocalRoots, s as optimizeImageToPng, t as monitorWebChannel, u as extractLocationData } from "./monitor-C5_C_RGJ.js";
13
- import { t as loginWeb } from "./login-DSUTCcJ7.js";
10
+ import { c as extractContactContext, d as extractMediaPlaceholder, p as extractText, u as extractLocationData } from "./send-api-DoycpOvC.js";
11
+ import { n as newConnectionId, r as waitForWaConnection, t as createWaSocket } from "./session-BXC3R43P.js";
12
+ import { n as resolveWebAccountId, t as getActiveWebListener } from "./active-listener-DTbKS-j-.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-5u0dVXnB.js";
14
+ import { t as loginWeb } from "./login-B_u009k0.js";
14
15
  import { HEARTBEAT_PROMPT, HEARTBEAT_TOKEN, SILENT_REPLY_TOKEN, stripHeartbeatToken } from "openclaw/plugin-sdk/reply-runtime";
15
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 };
@@ -5,7 +5,7 @@ import { n as isWhatsAppNewsletterJid } from "./normalize-target-nXxC_hxG.js";
5
5
  import { t as getRegisteredWhatsAppConnectionController } from "./connection-controller-registry-D_iIGz5m.js";
6
6
  import "./normalize-Y3eBdM8a.js";
7
7
  import { a as markdownToWhatsApp, s as toWhatsappJid } from "./text-runtime-DFFwk5z6.js";
8
- import { a as resolveWhatsAppOutboundMediaUrls, i as prepareWhatsAppOutboundMedia, n as normalizeWhatsAppPayloadText } from "./outbound-media-contract-BPdOq7Hb.js";
8
+ import { a as resolveWhatsAppOutboundMediaUrls, i as prepareWhatsAppOutboundMedia, n as normalizeWhatsAppPayloadText } from "./outbound-media-contract-Dzi1ILTd.js";
9
9
  import { formatCliCommand } from "openclaw/plugin-sdk/cli-runtime";
10
10
  import { generateSecureUuid } from "openclaw/plugin-sdk/core";
11
11
  import { redactIdentifier } from "openclaw/plugin-sdk/logging-core";