@openclaw/whatsapp 2026.5.7 → 2026.5.10-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 (60) hide show
  1. package/dist/{access-control-CTj7P7WP.js → access-control-CdP8S3rJ.js} +66 -111
  2. package/dist/{action-runtime-BqYZmBX_.js → action-runtime-CMhO8liB.js} +1 -1
  3. package/dist/action-runtime-api.js +1 -1
  4. package/dist/action-runtime.runtime.js +1 -1
  5. package/dist/api.js +120 -12
  6. package/dist/{auth-store-BNZmNP-s.js → auth-store-CjEimXKX.js} +19 -41
  7. package/dist/{channel-CTr3YjO8.js → channel-BxntAClG.js} +39 -12
  8. package/dist/channel-config-api.js +1 -1
  9. package/dist/channel-plugin-api.js +1 -1
  10. package/dist/{channel-react-action-BuSTzmDX.js → channel-react-action-DJvzhIPw.js} +1 -1
  11. package/dist/{channel.runtime-C3i9Svfj.js → channel.runtime-CNdPCK3G.js} +5 -5
  12. package/dist/{channel.setup-BYtkDwHe.js → channel.setup-BqlcEVzR.js} +4 -4
  13. package/dist/{connection-controller-BCIuChXD.js → connection-controller-DX2phM7V.js} +6 -197
  14. package/dist/constants.js +1 -1
  15. package/dist/contract-api.js +7 -7
  16. package/dist/{directory-config-BNCbgnmy.js → directory-config-o-muXLgk.js} +1 -1
  17. package/dist/directory-contract-api.js +1 -1
  18. package/dist/doctor-contract-api.js +1 -1
  19. package/dist/{identity-DhaC0MoD.js → identity-KxdJfH7p.js} +1 -1
  20. package/dist/legacy-session-surface-api.js +1 -1
  21. package/dist/legacy-state-migrations-api.js +1 -1
  22. package/dist/light-runtime-api.js +3 -3
  23. package/dist/{login-DSUTCcJ7.js → login-DV99D0IN.js} +4 -3
  24. package/dist/{login-qr-dfs8tfGo.js → login-qr-cKndAXTv.js} +3 -2
  25. package/dist/login-qr-runtime.js +1 -1
  26. package/dist/{monitor-C5_C_RGJ.js → monitor-mfy3Mmq-.js} +111 -687
  27. package/dist/{outbound-adapter-CbR17Ehj.js → outbound-adapter-B9ZW8sht.js} +3 -3
  28. package/dist/{outbound-base-BmzhutvF.js → outbound-base-MVpg2zU2.js} +8 -3
  29. package/dist/{outbound-media-contract-BPdOq7Hb.js → outbound-media-contract-BzWwBppP.js} +37 -41
  30. package/dist/outbound-payload-test-api.js +1 -1
  31. package/dist/{quoted-message-BXs55Teh.js → quoted-message-DQ6hAr34.js} +1 -1
  32. package/dist/runtime-api.js +11 -10
  33. package/dist/security-contract-api.js +1 -1
  34. package/dist/send-api-DsbCqDre.js +697 -0
  35. package/dist/{send-CxctcFGT.js → send-u88yh8Hw.js} +2 -3
  36. package/dist/session-DeIU_vjJ.js +198 -0
  37. package/dist/{session.runtime-C1eSE_KK.js → session.runtime-B9VlYnWQ.js} +1 -1
  38. package/dist/{setup-surface-CF3l3gEZ.js → setup-finalize-D3YuMUBs.js} +5 -52
  39. package/dist/setup-plugin-api.js +1 -1
  40. package/dist/setup-surface-CHjYlKJc.js +45 -0
  41. package/dist/{shared-CTSTwprn.js → shared-CgYT3IzU.js} +7 -7
  42. package/dist/{state-migrations-DnCdvoYD.js → state-migrations-CtdIArlK.js} +2 -1
  43. package/dist/test-api.js +2 -2
  44. package/dist/{text-runtime-DFFwk5z6.js → text-runtime-DBKC9uEi.js} +27 -2
  45. package/package.json +6 -6
  46. package/dist/rolldown-runtime-RkAeH_Qm.js +0 -27
  47. /package/dist/{active-listener-N7GFKsuN.js → active-listener-D2NHQ5Og.js} +0 -0
  48. /package/dist/{agent-tools-login-DpRxLNRB.js → agent-tools-login-DYKYW5Nh.js} +0 -0
  49. /package/dist/{audio-preflight.runtime-Bcdsl_ri.js → audio-preflight.runtime-CIFjeaEN.js} +0 -0
  50. /package/dist/{command-policy-O8sRnqUV.js → command-policy-BgZRZ31o.js} +0 -0
  51. /package/dist/{config-schema-Dmo66Ubb.js → config-schema-cSC7M4YA.js} +0 -0
  52. /package/dist/{constants-DLGCIbfl.js → constants-yKXGCGU9.js} +0 -0
  53. /package/dist/{doctor-A9tXm9Om.js → doctor-BrgepDUP.js} +0 -0
  54. /package/dist/{group-session-contract-B8QBn0I2.js → group-session-contract-DL-SLclv.js} +0 -0
  55. /package/dist/{reply-resolver.runtime-BRCgoO4C.js → reply-resolver.runtime-CROyXXQh.js} +0 -0
  56. /package/dist/{runtime-6fZ67abR.js → runtime-DdodQB8G.js} +0 -0
  57. /package/dist/{runtime-group-policy-Gp1lQ0at.js → runtime-group-policy-BH_U23qp.js} +0 -0
  58. /package/dist/{security-contract-DqH8JDX6.js → security-contract-BzlZFreO.js} +0 -0
  59. /package/dist/{session-contract-B0efQf9P.js → session-contract-BNUscPf4.js} +0 -0
  60. /package/dist/{setup-core-DZKvpzbH.js → setup-core-DnhO0PjG.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-BzWwBppP.js";
3
+ import { t as createWhatsAppOutboundBase } from "./outbound-base-MVpg2zU2.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-u88yh8Hw.js").then((n) => n.a);
10
10
  return whatsAppSendModulePromise;
11
11
  }
12
12
  function normalizeOutboundText(text) {
@@ -1,6 +1,6 @@
1
- import { s as toWhatsappJid } from "./text-runtime-DFFwk5z6.js";
2
- import { n as normalizeWhatsAppPayloadText, t as normalizeWhatsAppOutboundPayload } from "./outbound-media-contract-BPdOq7Hb.js";
3
- import { i as lookupInboundMessageMetaForTarget } from "./quoted-message-BXs55Teh.js";
1
+ import { s as toWhatsappJid } from "./text-runtime-DBKC9uEi.js";
2
+ import { n as normalizeWhatsAppPayloadText, t as normalizeWhatsAppOutboundPayload } from "./outbound-media-contract-BzWwBppP.js";
3
+ import { i as lookupInboundMessageMetaForTarget } from "./quoted-message-DQ6hAr34.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";
6
6
  import { resolveOutboundSendDep } from "openclaw/plugin-sdk/outbound-send-deps";
@@ -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
+ import { t as text_runtime_exports } from "./text-runtime-DBKC9uEi.js";
1
2
  import { t as formatError } from "./session-errors-CSuKZPub.js";
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-B9ZW8sht.js";
2
2
  export { whatsappOutbound };
@@ -1,4 +1,4 @@
1
- import { i as jidToE164 } from "./text-runtime-DFFwk5z6.js";
1
+ import { i as jidToE164 } from "./text-runtime-DBKC9uEi.js";
2
2
  //#region extensions/whatsapp/src/quoted-message.ts
3
3
  const CACHE_TTL_MS = 600 * 1e3;
4
4
  const MAX_ENTRIES = 500;
@@ -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-CMhO8liB.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-u88yh8Hw.js";
5
5
  import { startWebLoginWithQr, waitForWebLogin } from "./login-qr-runtime.js";
6
- import { t as createWhatsAppLoginTool } from "./agent-tools-login-DpRxLNRB.js";
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";
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";
6
+ import { t as createWhatsAppLoginTool } from "./agent-tools-login-DYKYW5Nh.js";
7
+ import { n as setWhatsAppRuntime } from "./runtime-DdodQB8G.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-CjEimXKX.js";
9
+ import { t as DEFAULT_WEB_MEDIA_BYTES } from "./constants-yKXGCGU9.js";
10
+ import { c as extractContactContext, d as extractMediaPlaceholder, p as extractText, u as extractLocationData } from "./send-api-DsbCqDre.js";
11
+ import { n as newConnectionId, r as waitForWaConnection, t as createWaSocket } from "./session-DeIU_vjJ.js";
12
+ import { n as resolveWebAccountId, t as getActiveWebListener } from "./active-listener-D2NHQ5Og.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-mfy3Mmq-.js";
14
+ import { t as loginWeb } from "./login-DV99D0IN.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 };
@@ -1,2 +1,2 @@
1
- import { n as unsupportedSecretRefSurfacePatterns, t as collectUnsupportedSecretRefConfigCandidates } from "./security-contract-DqH8JDX6.js";
1
+ import { n as unsupportedSecretRefSurfacePatterns, t as collectUnsupportedSecretRefConfigCandidates } from "./security-contract-BzlZFreO.js";
2
2
  export { collectUnsupportedSecretRefConfigCandidates, unsupportedSecretRefSurfacePatterns };