From fcc042559f96e162c53b605829acb62b46305cfa Mon Sep 17 00:00:00 2001 From: Peter Steinberger Date: Sun, 10 May 2026 13:59:54 +0100 Subject: [PATCH] build(deps): refresh workspace dependencies --- CHANGELOG.md | 1 + docs/install/bun.md | 4 +- extensions/whatsapp/package.json | 2 +- extensions/whatsapp/setup-entry.test.ts | 2 +- extensions/whatsapp/src/auto-reply/util.ts | 1 - .../auto-reply/web-auto-reply-utils.test.ts | 2 +- .../whatsapp/src/connection-controller.ts | 2 +- extensions/whatsapp/src/inbound.media.test.ts | 5 +- extensions/whatsapp/src/inbound.test.ts | 36 ++-- .../whatsapp/src/inbound/extract.test.ts | 2 +- extensions/whatsapp/src/inbound/extract.ts | 8 +- .../whatsapp/src/inbound/media.node.test.ts | 2 +- extensions/whatsapp/src/inbound/media.ts | 2 +- extensions/whatsapp/src/inbound/monitor.ts | 6 +- .../whatsapp/src/inbound/outbound-mentions.ts | 2 +- .../whatsapp/src/inbound/runtime-api.ts | 2 +- .../whatsapp/src/inbound/send-api.test.ts | 6 +- extensions/whatsapp/src/inbound/send-api.ts | 2 +- .../whatsapp/src/inbound/send-result.test.ts | 2 +- .../whatsapp/src/inbound/send-result.ts | 2 +- extensions/whatsapp/src/inbound/types.ts | 2 +- .../whatsapp/src/qa-driver.runtime.test.ts | 2 +- extensions/whatsapp/src/qa-driver.runtime.ts | 2 +- extensions/whatsapp/src/quoted-message.ts | 2 +- extensions/whatsapp/src/session.runtime.ts | 2 +- extensions/whatsapp/src/session.ts | 59 +++---- package.json | 6 +- ....0-rc10.patch => baileys@7.0.0-rc10.patch} | 0 pnpm-lock.yaml | 166 +++++++++--------- pnpm-workspace.yaml | 2 +- .../e2e/commitments-safety-docker-client.ts | 15 +- scripts/postinstall-bundled-plugins.mjs | 15 +- .../package-manifest.contract.test.ts | 2 +- test/mocks/baileys.ts | 2 +- .../postinstall-bundled-plugins.test.ts | 1 - 35 files changed, 171 insertions(+), 198 deletions(-) rename patches/{@whiskeysockets__baileys@7.0.0-rc10.patch => baileys@7.0.0-rc10.patch} (100%) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3237394bb3a..ee9a1c927e9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -24,6 +24,7 @@ Docs: https://docs.openclaw.ai - CLI/onboarding: improve setup, onboarding, configure, and channel command wayfinding so terminal flows explain the next useful command instead of relying on terse setup labels. - Agents/Codex: remove the configurable Codex dynamic-tools profile so Codex app-server always owns workspace, edit, patch, exec, process, and plan tools while OpenClaw integration tools remain available. - macOS app: update the Peekaboo bridge dependency to Peekaboo 3.0.0. +- Dependencies: refresh workspace pins and move the WhatsApp plugin from `@whiskeysockets/baileys` to `baileys` while keeping the `7.0.0-rc10` runtime. ### Fixes diff --git a/docs/install/bun.md b/docs/install/bun.md index 7c8ca8f6a10..88406da5c92 100644 --- a/docs/install/bun.md +++ b/docs/install/bun.md @@ -39,13 +39,13 @@ Bun is an optional local runtime for running TypeScript directly (`bun run ...`, Bun blocks dependency lifecycle scripts unless explicitly trusted. For this repo, the commonly blocked scripts are not required: -- `@whiskeysockets/baileys` `preinstall` -- checks Node major >= 20 (OpenClaw defaults to Node 24 and still supports Node 22 LTS, currently `22.16+`) +- `baileys` `preinstall` -- checks Node major >= 20 (OpenClaw defaults to Node 24 and still supports Node 22 LTS, currently `22.16+`) - `protobufjs` `postinstall` -- emits warnings about incompatible version schemes (no build artifacts) If you hit a runtime issue that requires these scripts, trust them explicitly: ```sh -bun pm trust @whiskeysockets/baileys protobufjs +bun pm trust baileys protobufjs ``` ## Caveats diff --git a/extensions/whatsapp/package.json b/extensions/whatsapp/package.json index a9c207a4c9f..e459a8dbe4d 100644 --- a/extensions/whatsapp/package.json +++ b/extensions/whatsapp/package.json @@ -8,7 +8,7 @@ }, "type": "module", "dependencies": { - "@whiskeysockets/baileys": "7.0.0-rc10", + "baileys": "7.0.0-rc10", "https-proxy-agent": "^9.0.0", "jimp": "^1.6.1", "typebox": "1.1.38", diff --git a/extensions/whatsapp/setup-entry.test.ts b/extensions/whatsapp/setup-entry.test.ts index edd0a903d2b..a4732baf7e5 100644 --- a/extensions/whatsapp/setup-entry.test.ts +++ b/extensions/whatsapp/setup-entry.test.ts @@ -1,6 +1,6 @@ import { describe, expect, it, vi } from "vitest"; -vi.mock("@whiskeysockets/baileys", () => { +vi.mock("baileys", () => { throw new Error("setup plugin load must not load Baileys"); }); diff --git a/extensions/whatsapp/src/auto-reply/util.ts b/extensions/whatsapp/src/auto-reply/util.ts index afd5ea41296..a121f7a62bb 100644 --- a/extensions/whatsapp/src/auto-reply/util.ts +++ b/extensions/whatsapp/src/auto-reply/util.ts @@ -55,7 +55,6 @@ export function isLikelyWhatsAppCryptoError(reason: unknown) { return false; } return ( - haystack.includes("@whiskeysockets/baileys") || haystack.includes("baileys") || haystack.includes("noise-handler") || haystack.includes("aesdecryptgcm") diff --git a/extensions/whatsapp/src/auto-reply/web-auto-reply-utils.test.ts b/extensions/whatsapp/src/auto-reply/web-auto-reply-utils.test.ts index 4cc0fe2cd10..8ab1cd85f46 100644 --- a/extensions/whatsapp/src/auto-reply/web-auto-reply-utils.test.ts +++ b/extensions/whatsapp/src/auto-reply/web-auto-reply-utils.test.ts @@ -342,7 +342,7 @@ describe("web auto-reply util", () => { describe("isLikelyWhatsAppCryptoError", () => { it("matches known Baileys crypto auth errors (Error)", () => { const err = new Error("bad mac"); - err.stack = "at something\nat @whiskeysockets/baileys/noise-handler\n"; + err.stack = "at something\nat baileys/noise-handler\n"; expect(isLikelyWhatsAppCryptoError(err)).toBe(true); }); diff --git a/extensions/whatsapp/src/connection-controller.ts b/extensions/whatsapp/src/connection-controller.ts index 6fd0dc79ec6..c75849ce52e 100644 --- a/extensions/whatsapp/src/connection-controller.ts +++ b/extensions/whatsapp/src/connection-controller.ts @@ -1,4 +1,4 @@ -import { DisconnectReason, type WASocket } from "@whiskeysockets/baileys"; +import { DisconnectReason, type WASocket } from "baileys"; import { info } from "openclaw/plugin-sdk/runtime-env"; import type { RuntimeEnv } from "openclaw/plugin-sdk/runtime-env"; import { diff --git a/extensions/whatsapp/src/inbound.media.test.ts b/extensions/whatsapp/src/inbound.media.test.ts index 0fa01bf848c..4fb9ed96b52 100644 --- a/extensions/whatsapp/src/inbound.media.test.ts +++ b/extensions/whatsapp/src/inbound.media.test.ts @@ -93,9 +93,8 @@ const HOME = path.join(os.tmpdir(), `openclaw-inbound-media-${crypto.randomUUID( const ORIGINAL_HOME = process.env.HOME; process.env.HOME = HOME; -vi.mock("@whiskeysockets/baileys", async () => { - const actual = - await vi.importActual("@whiskeysockets/baileys"); +vi.mock("baileys", async () => { + const actual = await vi.importActual("baileys"); const jpegBuffer = Buffer.from([ 0xff, 0xd8, 0xff, 0xdb, 0x00, 0x43, 0x00, 0x03, 0x02, 0x02, 0x02, 0x02, 0x02, 0x03, 0x02, 0x02, 0x02, 0x03, 0x03, 0x03, 0x03, 0x04, 0x06, 0x04, 0x04, 0x04, 0x04, 0x04, 0x08, 0x06, 0x06, 0x05, diff --git a/extensions/whatsapp/src/inbound.test.ts b/extensions/whatsapp/src/inbound.test.ts index 5444cc5611f..6255474a1df 100644 --- a/extensions/whatsapp/src/inbound.test.ts +++ b/extensions/whatsapp/src/inbound.test.ts @@ -10,21 +10,21 @@ describe("web inbound helpers", () => { it("prefers the main conversation body", () => { const body = extractText({ conversation: " hello ", - } as unknown as import("@whiskeysockets/baileys").proto.IMessage); + } as unknown as import("baileys").proto.IMessage); expect(body).toBe("hello"); }); it("falls back to captions when conversation text is missing", () => { const body = extractText({ imageMessage: { caption: " caption " }, - } as unknown as import("@whiskeysockets/baileys").proto.IMessage); + } as unknown as import("baileys").proto.IMessage); expect(body).toBe("caption"); }); it("handles document captions", () => { const body = extractText({ documentMessage: { caption: " doc " }, - } as unknown as import("@whiskeysockets/baileys").proto.IMessage); + } as unknown as import("baileys").proto.IMessage); expect(body).toBe("doc"); }); @@ -40,7 +40,7 @@ describe("web inbound helpers", () => { "END:VCARD", ].join("\n"), }, - } as unknown as import("@whiskeysockets/baileys").proto.IMessage); + } as unknown as import("baileys").proto.IMessage); expect(body).toBe(""); expect( extractContactContext({ @@ -54,7 +54,7 @@ describe("web inbound helpers", () => { "END:VCARD", ].join("\n"), }, - } as unknown as import("@whiskeysockets/baileys").proto.IMessage), + } as unknown as import("baileys").proto.IMessage), ).toEqual({ kind: "contact", total: 1, @@ -74,7 +74,7 @@ describe("web inbound helpers", () => { "END:VCARD", ].join("\n"), }, - } as unknown as import("@whiskeysockets/baileys").proto.IMessage); + } as unknown as import("baileys").proto.IMessage); expect(body).toBe(""); }); @@ -89,7 +89,7 @@ describe("web inbound helpers", () => { "END:VCARD", ].join("\n"), }, - } as unknown as import("@whiskeysockets/baileys").proto.IMessage); + } as unknown as import("baileys").proto.IMessage); expect(body).toBe(""); }); @@ -106,7 +106,7 @@ describe("web inbound helpers", () => { "END:VCARD", ].join("\n"), }, - } as unknown as import("@whiskeysockets/baileys").proto.IMessage); + } as unknown as import("baileys").proto.IMessage); expect(body).toBe(""); }); @@ -157,7 +157,7 @@ describe("web inbound helpers", () => { }, ], }, - } as unknown as import("@whiskeysockets/baileys").proto.IMessage); + } as unknown as import("baileys").proto.IMessage); expect(body).toBe(""); }); @@ -179,7 +179,7 @@ describe("web inbound helpers", () => { {}, ], }, - } as unknown as import("@whiskeysockets/baileys").proto.IMessage); + } as unknown as import("baileys").proto.IMessage); expect(body).toBe(""); }); @@ -195,7 +195,7 @@ describe("web inbound helpers", () => { "END:VCARD", ].join("\n"), }, - } as unknown as import("@whiskeysockets/baileys").proto.IMessage); + } as unknown as import("baileys").proto.IMessage); expect(body).toBe(""); expect(body).not.toContain("Yohann >"); expect(body).not.toContain(" { "END:VCARD", ].join("\n"), }, - } as unknown as import("@whiskeysockets/baileys").proto.IMessage); + } as unknown as import("baileys").proto.IMessage); expect(context?.contacts[0]?.name).toContain("Yohann >"); }); @@ -220,7 +220,7 @@ describe("web inbound helpers", () => { contactsArrayMessage: { contacts: [{}, {}], }, - } as unknown as import("@whiskeysockets/baileys").proto.IMessage); + } as unknown as import("baileys").proto.IMessage); expect(body).toBe(""); }); @@ -229,7 +229,7 @@ describe("web inbound helpers", () => { viewOnceMessageV2Extension: { message: { conversation: " hello " }, }, - } as unknown as import("@whiskeysockets/baileys").proto.IMessage); + } as unknown as import("baileys").proto.IMessage); expect(body).toBe("hello"); }); @@ -237,12 +237,12 @@ describe("web inbound helpers", () => { expect( extractMediaPlaceholder({ imageMessage: {}, - } as unknown as import("@whiskeysockets/baileys").proto.IMessage), + } as unknown as import("baileys").proto.IMessage), ).toBe(""); expect( extractMediaPlaceholder({ audioMessage: {}, - } as unknown as import("@whiskeysockets/baileys").proto.IMessage), + } as unknown as import("baileys").proto.IMessage), ).toBe(""); }); @@ -256,7 +256,7 @@ describe("web inbound helpers", () => { accuracyInMeters: 12, comment: "Meet here", }, - } as unknown as import("@whiskeysockets/baileys").proto.IMessage); + } as unknown as import("baileys").proto.IMessage); expect(location).toEqual({ latitude: 48.858844, longitude: 2.294351, @@ -277,7 +277,7 @@ describe("web inbound helpers", () => { accuracyInMeters: 20, caption: "On the move", }, - } as unknown as import("@whiskeysockets/baileys").proto.IMessage); + } as unknown as import("baileys").proto.IMessage); expect(location).toEqual({ latitude: 37.819929, longitude: -122.478255, diff --git a/extensions/whatsapp/src/inbound/extract.test.ts b/extensions/whatsapp/src/inbound/extract.test.ts index 0414c11621e..fb30b0fad11 100644 --- a/extensions/whatsapp/src/inbound/extract.test.ts +++ b/extensions/whatsapp/src/inbound/extract.test.ts @@ -1,4 +1,4 @@ -import type { proto } from "@whiskeysockets/baileys"; +import type { proto } from "baileys"; import { describe, expect, it } from "vitest"; import { extractMentionedJids, hasInboundUserContent } from "./extract.js"; diff --git a/extensions/whatsapp/src/inbound/extract.ts b/extensions/whatsapp/src/inbound/extract.ts index ec2677b5c2f..7542bf0e34e 100644 --- a/extensions/whatsapp/src/inbound/extract.ts +++ b/extensions/whatsapp/src/inbound/extract.ts @@ -1,9 +1,5 @@ -import type { proto } from "@whiskeysockets/baileys"; -import { - extractMessageContent, - getContentType, - normalizeMessageContent, -} from "@whiskeysockets/baileys"; +import type { proto } from "baileys"; +import { extractMessageContent, getContentType, normalizeMessageContent } from "baileys"; import { formatLocationText, type NormalizedLocation } from "openclaw/plugin-sdk/channel-inbound"; import { logVerbose } from "openclaw/plugin-sdk/runtime-env"; import { resolveComparableIdentity, type WhatsAppReplyContext } from "../identity.js"; diff --git a/extensions/whatsapp/src/inbound/media.node.test.ts b/extensions/whatsapp/src/inbound/media.node.test.ts index f93e3452a4e..65ec115c185 100644 --- a/extensions/whatsapp/src/inbound/media.node.test.ts +++ b/extensions/whatsapp/src/inbound/media.node.test.ts @@ -8,7 +8,7 @@ const { normalizeMessageContent, downloadMediaMessage } = vi.hoisted(() => ({ downloadMediaMessage: vi.fn().mockResolvedValue(Buffer.from("fake-media-data")), })); -vi.mock("@whiskeysockets/baileys", async () => { +vi.mock("baileys", async () => { return { DisconnectReason: { loggedOut: 401 }, normalizeMessageContent, diff --git a/extensions/whatsapp/src/inbound/media.ts b/extensions/whatsapp/src/inbound/media.ts index aee8cce81a5..07a90a1739f 100644 --- a/extensions/whatsapp/src/inbound/media.ts +++ b/extensions/whatsapp/src/inbound/media.ts @@ -1,4 +1,4 @@ -import type { proto, WAMessage } from "@whiskeysockets/baileys"; +import type { proto, WAMessage } from "baileys"; import { logVerbose } from "openclaw/plugin-sdk/runtime-env"; import type { createWaSocket } from "../session.js"; import { extractContextInfo } from "./extract.js"; diff --git a/extensions/whatsapp/src/inbound/monitor.ts b/extensions/whatsapp/src/inbound/monitor.ts index cf10de5add1..9683a6be88c 100644 --- a/extensions/whatsapp/src/inbound/monitor.ts +++ b/extensions/whatsapp/src/inbound/monitor.ts @@ -5,7 +5,7 @@ import type { GroupMetadata, WAMessage, WASocket, -} from "@whiskeysockets/baileys"; +} from "baileys"; import { recordChannelActivity } from "openclaw/plugin-sdk/channel-activity-runtime"; import { formatLocationText } from "openclaw/plugin-sdk/channel-inbound"; import { createInboundDebouncer } from "openclaw/plugin-sdk/channel-inbound-debounce"; @@ -839,9 +839,7 @@ export async function attachWebInboxToSocket( await enqueueInboundMessage(msg, inbound, enriched); } }; - const handleConnectionUpdate = ( - update: Partial, - ) => { + const handleConnectionUpdate = (update: Partial) => { try { if (update.connection === "close") { if (options.socketRef?.current === sock) { diff --git a/extensions/whatsapp/src/inbound/outbound-mentions.ts b/extensions/whatsapp/src/inbound/outbound-mentions.ts index 1996e5d06ca..fbaa081d9fe 100644 --- a/extensions/whatsapp/src/inbound/outbound-mentions.ts +++ b/extensions/whatsapp/src/inbound/outbound-mentions.ts @@ -1,4 +1,4 @@ -import type { AnyMessageContent } from "@whiskeysockets/baileys"; +import type { AnyMessageContent } from "baileys"; export type WhatsAppOutboundMentionParticipant = | string diff --git a/extensions/whatsapp/src/inbound/runtime-api.ts b/extensions/whatsapp/src/inbound/runtime-api.ts index e11867e4225..abbb624f5fe 100644 --- a/extensions/whatsapp/src/inbound/runtime-api.ts +++ b/extensions/whatsapp/src/inbound/runtime-api.ts @@ -3,5 +3,5 @@ export { downloadMediaMessage, isJidGroup, normalizeMessageContent, -} from "@whiskeysockets/baileys"; +} from "baileys"; export { saveMediaBuffer } from "./save-media.runtime.js"; diff --git a/extensions/whatsapp/src/inbound/send-api.test.ts b/extensions/whatsapp/src/inbound/send-api.test.ts index 2f9f467ed01..8206758e1c5 100644 --- a/extensions/whatsapp/src/inbound/send-api.test.ts +++ b/extensions/whatsapp/src/inbound/send-api.test.ts @@ -1,11 +1,7 @@ import fs from "node:fs"; import os from "node:os"; import path from "node:path"; -import type { - AnyMessageContent, - MiscMessageGenerationOptions, - WAMessage, -} from "@whiskeysockets/baileys"; +import type { AnyMessageContent, MiscMessageGenerationOptions, WAMessage } from "baileys"; import { listMessageReceiptPlatformIds } from "openclaw/plugin-sdk/channel-message"; import { afterEach, beforeEach, describe, expect, it, vi } from "vitest"; import { resolveWhatsAppOutboundMentions } from "./outbound-mentions.js"; diff --git a/extensions/whatsapp/src/inbound/send-api.ts b/extensions/whatsapp/src/inbound/send-api.ts index d225b4c59e1..756a1c7bd93 100644 --- a/extensions/whatsapp/src/inbound/send-api.ts +++ b/extensions/whatsapp/src/inbound/send-api.ts @@ -3,7 +3,7 @@ import type { MiscMessageGenerationOptions, WAMessage, WAPresence, -} from "@whiskeysockets/baileys"; +} from "baileys"; import { recordChannelActivity } from "openclaw/plugin-sdk/channel-activity-runtime"; import { isWhatsAppNewsletterJid } from "../normalize.js"; import { buildQuotedMessageOptions } from "../quoted-message.js"; diff --git a/extensions/whatsapp/src/inbound/send-result.test.ts b/extensions/whatsapp/src/inbound/send-result.test.ts index 1ac6845f532..4fb87ff6a85 100644 --- a/extensions/whatsapp/src/inbound/send-result.test.ts +++ b/extensions/whatsapp/src/inbound/send-result.test.ts @@ -1,4 +1,4 @@ -import type { WAMessage } from "@whiskeysockets/baileys"; +import type { WAMessage } from "baileys"; import { describe, expect, it } from "vitest"; import { combineWhatsAppSendResults, normalizeWhatsAppSendResult } from "./send-result.js"; diff --git a/extensions/whatsapp/src/inbound/send-result.ts b/extensions/whatsapp/src/inbound/send-result.ts index 1190bd35b42..a0f4f929802 100644 --- a/extensions/whatsapp/src/inbound/send-result.ts +++ b/extensions/whatsapp/src/inbound/send-result.ts @@ -1,4 +1,4 @@ -import type { WAMessage, WAMessageKey } from "@whiskeysockets/baileys"; +import type { WAMessage, WAMessageKey } from "baileys"; import { createMessageReceiptFromOutboundResults, listMessageReceiptPlatformIds, diff --git a/extensions/whatsapp/src/inbound/types.ts b/extensions/whatsapp/src/inbound/types.ts index 0943138729a..fde25ec06df 100644 --- a/extensions/whatsapp/src/inbound/types.ts +++ b/extensions/whatsapp/src/inbound/types.ts @@ -1,4 +1,4 @@ -import type { AnyMessageContent, MiscMessageGenerationOptions } from "@whiskeysockets/baileys"; +import type { AnyMessageContent, MiscMessageGenerationOptions } from "baileys"; import type { NormalizedLocation } from "openclaw/plugin-sdk/channel-inbound"; import type { PollInput } from "openclaw/plugin-sdk/poll-runtime"; import type { WhatsAppIdentity, WhatsAppReplyContext, WhatsAppSelfIdentity } from "../identity.js"; diff --git a/extensions/whatsapp/src/qa-driver.runtime.test.ts b/extensions/whatsapp/src/qa-driver.runtime.test.ts index da61440fb70..0b85bbca37c 100644 --- a/extensions/whatsapp/src/qa-driver.runtime.test.ts +++ b/extensions/whatsapp/src/qa-driver.runtime.test.ts @@ -1,5 +1,5 @@ import { EventEmitter } from "node:events"; -import type { WAMessage } from "@whiskeysockets/baileys"; +import type { WAMessage } from "baileys"; import { afterEach, describe, expect, it, vi } from "vitest"; import { startWhatsAppQaDriverSession } from "./qa-driver.runtime.js"; diff --git a/extensions/whatsapp/src/qa-driver.runtime.ts b/extensions/whatsapp/src/qa-driver.runtime.ts index 07dd9f1a23d..caf4c6d3ef6 100644 --- a/extensions/whatsapp/src/qa-driver.runtime.ts +++ b/extensions/whatsapp/src/qa-driver.runtime.ts @@ -1,4 +1,4 @@ -import type { WAMessage } from "@whiskeysockets/baileys"; +import type { WAMessage } from "baileys"; import { extractText } from "./inbound/extract.js"; import { createWebSendApi } from "./inbound/send-api.js"; import { createWaSocket, waitForWaConnection } from "./session.js"; diff --git a/extensions/whatsapp/src/quoted-message.ts b/extensions/whatsapp/src/quoted-message.ts index 7f06b47c96d..e21b983b901 100644 --- a/extensions/whatsapp/src/quoted-message.ts +++ b/extensions/whatsapp/src/quoted-message.ts @@ -1,4 +1,4 @@ -import type { MiscMessageGenerationOptions } from "@whiskeysockets/baileys"; +import type { MiscMessageGenerationOptions } from "baileys"; import { jidToE164 } from "./text-runtime.js"; // ── Inbound message metadata cache ────────────────────────────────────── diff --git a/extensions/whatsapp/src/session.runtime.ts b/extensions/whatsapp/src/session.runtime.ts index 3a3762d17c2..d0bc9801b97 100644 --- a/extensions/whatsapp/src/session.runtime.ts +++ b/extensions/whatsapp/src/session.runtime.ts @@ -5,4 +5,4 @@ export { makeCacheableSignalKeyStore, makeWASocket, useMultiFileAuthState, -} from "@whiskeysockets/baileys"; +} from "baileys"; diff --git a/extensions/whatsapp/src/session.ts b/extensions/whatsapp/src/session.ts index e8e5495411a..9c60229efcc 100644 --- a/extensions/whatsapp/src/session.ts +++ b/extensions/whatsapp/src/session.ts @@ -182,38 +182,35 @@ export async function createWaSocket( }); sock.ev.on("creds.update", () => enqueueSaveCreds(authDir, saveCreds, sessionLogger)); - sock.ev.on( - "connection.update", - async (update: Partial) => { - try { - const { connection, lastDisconnect, qr } = update; - if (qr) { - opts.onQr?.(qr); - if (printQr) { - console.log("Open the WhatsApp app, go to Linked Devices, then scan this QR:"); - void printTerminalQr(qr).catch((err) => { - sessionLogger.warn({ error: String(err) }, "failed rendering WhatsApp QR"); - }); - } + sock.ev.on("connection.update", async (update: Partial) => { + try { + const { connection, lastDisconnect, qr } = update; + if (qr) { + opts.onQr?.(qr); + if (printQr) { + console.log("Open the WhatsApp app, go to Linked Devices, then scan this QR:"); + void printTerminalQr(qr).catch((err) => { + sessionLogger.warn({ error: String(err) }, "failed rendering WhatsApp QR"); + }); } - if (connection === "close") { - const status = getStatusCode(lastDisconnect?.error); - if (status === LOGGED_OUT_STATUS) { - console.error( - danger( - `WhatsApp session logged out. Run: ${formatCliCommand("openclaw channels login")}`, - ), - ); - } - } - if (connection === "open" && verbose) { - console.log(success("WhatsApp Web connected.")); - } - } catch (err) { - sessionLogger.error({ error: String(err) }, "connection.update handler error"); } - }, - ); + if (connection === "close") { + const status = getStatusCode(lastDisconnect?.error); + if (status === LOGGED_OUT_STATUS) { + console.error( + danger( + `WhatsApp session logged out. Run: ${formatCliCommand("openclaw channels login")}`, + ), + ); + } + } + if (connection === "open" && verbose) { + console.log(success("WhatsApp Web connected.")); + } + } catch (err) { + sessionLogger.error({ error: String(err) }, "connection.update handler error"); + } + }); // Handle WebSocket-level errors to prevent unhandled exceptions from crashing the process if (sock.ws && typeof (sock.ws as unknown as { on?: unknown }).on === "function") { @@ -308,7 +305,7 @@ export async function waitForWaConnection(sock: ReturnType) const evWithOff = sock.ev as unknown as OffCapable; const handler = (...args: unknown[]) => { - const update = (args[0] ?? {}) as Partial; + const update = (args[0] ?? {}) as Partial; if (update.connection === "open") { evWithOff.off?.("connection.update", handler); resolve(); diff --git a/package.json b/package.json index d6182ac7738..09319301e50 100644 --- a/package.json +++ b/package.json @@ -1784,7 +1784,7 @@ "@types/markdown-it": "^14.1.2", "@types/node": "25.6.2", "@types/ws": "^8.18.1", - "@typescript/native-preview": "7.0.0-dev.20260509.2", + "@typescript/native-preview": "7.0.0-dev.20260510.1", "@vitest/coverage-v8": "^4.1.5", "jscpd": "4.1.0", "jsdom": "^29.1.1", @@ -1849,7 +1849,7 @@ "@matrix-org/matrix-sdk-crypto-nodejs", "@tloncorp/api", "@tloncorp/tlon-skill", - "@whiskeysockets/baileys", + "baileys", "@whiskeysockets/libsignal-node", "authenticate-pam", "esbuild", @@ -1875,7 +1875,7 @@ } }, "patchedDependencies": { - "@whiskeysockets/baileys@7.0.0-rc10": "patches/@whiskeysockets__baileys@7.0.0-rc10.patch", + "baileys@7.0.0-rc10": "patches/baileys@7.0.0-rc10.patch", "@agentclientprotocol/claude-agent-acp@0.33.1": "patches/@agentclientprotocol__claude-agent-acp@0.33.1.patch" } } diff --git a/patches/@whiskeysockets__baileys@7.0.0-rc10.patch b/patches/baileys@7.0.0-rc10.patch similarity index 100% rename from patches/@whiskeysockets__baileys@7.0.0-rc10.patch rename to patches/baileys@7.0.0-rc10.patch diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 51b53362492..794f6babcd3 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -37,9 +37,9 @@ patchedDependencies: '@agentclientprotocol/claude-agent-acp@0.33.1': hash: 3995624bb834cc60fea1461c7ef33f1fcdd8fb58b8f43f2f1490bc689f6e1be2 path: patches/@agentclientprotocol__claude-agent-acp@0.33.1.patch - '@whiskeysockets/baileys@7.0.0-rc10': + baileys@7.0.0-rc10: hash: a9aea1790d2c65b1ae543c77faca4119bbfb91ee3b6ca6c38d1cad4f5702ada2 - path: patches/@whiskeysockets__baileys@7.0.0-rc10.patch + path: patches/baileys@7.0.0-rc10.patch importers: @@ -260,8 +260,8 @@ importers: specifier: ^8.18.1 version: 8.18.1 '@typescript/native-preview': - specifier: 7.0.0-dev.20260509.2 - version: 7.0.0-dev.20260509.2 + specifier: 7.0.0-dev.20260510.1 + version: 7.0.0-dev.20260510.1 '@vitest/coverage-v8': specifier: ^4.1.5 version: 4.1.5(@vitest/browser@4.1.5)(vitest@4.1.5) @@ -288,7 +288,7 @@ importers: version: 0.21.1(signal-polyfill@0.2.2) tsdown: specifier: 0.22.0 - version: 0.22.0(@typescript/native-preview@7.0.0-dev.20260509.2)(tsx@4.21.0)(typescript@6.0.3)(unrun@0.2.37) + version: 0.22.0(@typescript/native-preview@7.0.0-dev.20260510.1)(tsx@4.21.0)(typescript@6.0.3)(unrun@0.2.37) tsx: specifier: ^4.21.0 version: 4.21.0 @@ -1650,7 +1650,7 @@ importers: extensions/whatsapp: dependencies: - '@whiskeysockets/baileys': + baileys: specifier: 7.0.0-rc10 version: 7.0.0-rc10(patch_hash=a9aea1790d2c65b1ae543c77faca4119bbfb91ee3b6ca6c38d1cad4f5702ada2)(audio-decode@2.2.3)(jimp@1.6.1)(sharp@0.34.5) https-proxy-agent: @@ -4725,50 +4725,50 @@ packages: '@types/yauzl@2.10.3': resolution: {integrity: sha512-oJoftv0LSuaDZE3Le4DbKX+KS9G36NzOeSap90UIK0yMA/NhKJhqlSGtNDORNRaIbQfzjXDrQa0ytJ6mNRGz/Q==} - '@typescript/native-preview-darwin-arm64@7.0.0-dev.20260509.2': - resolution: {integrity: sha512-oG9KahiCpx4q70Ood/rRJhYio4oIMHEHfX0g0LhfenlSIjIonitZWjUmUVG9N9q1ev9QWcM8pWpDrGGP0Osp3Q==} + '@typescript/native-preview-darwin-arm64@7.0.0-dev.20260510.1': + resolution: {integrity: sha512-YpG99bf/Va1aLGP8SUQy1ClUvi4c6uTFrEQ0B5KzZb9TsOwH1RIrc/2n8UO3IAuilvwEA0EU4q8fEO3otVP2Sw==} engines: {node: '>=16.20.0'} cpu: [arm64] os: [darwin] - '@typescript/native-preview-darwin-x64@7.0.0-dev.20260509.2': - resolution: {integrity: sha512-xdEkp23Gu8I7PJCMmSMYtSLX76NKODWj74AoWFPi6MM59ICsjnTSqZf/HmXKSvuNZ5MGb4CMpP3c40dLjGB2PQ==} + '@typescript/native-preview-darwin-x64@7.0.0-dev.20260510.1': + resolution: {integrity: sha512-NUwhwHpQn7aSX2GGBuY2bjec+hFnIz2DAna4ksVneexVE20h2U0MFzBvWrqH2C0PzPxVvGOMg4fGCvhTs93nlw==} engines: {node: '>=16.20.0'} cpu: [x64] os: [darwin] - '@typescript/native-preview-linux-arm64@7.0.0-dev.20260509.2': - resolution: {integrity: sha512-rd+bMRtUAFBClOAKi9p2rOu6jPmnrjZVljoFyxHw+6bIRLerEQlxP+nIH1olC3HOZPyZ6/x75WtfzTHYeqffiQ==} + '@typescript/native-preview-linux-arm64@7.0.0-dev.20260510.1': + resolution: {integrity: sha512-T7Zuy6h0sU+38w+N3A+YgW0XVqxIMjeHyu+945rJkiP9zk52Mwp663t1ndyeAE/N2zV+q0SWQmHNuFSXl99wJw==} engines: {node: '>=16.20.0'} cpu: [arm64] os: [linux] - '@typescript/native-preview-linux-arm@7.0.0-dev.20260509.2': - resolution: {integrity: sha512-ar5HN/V/4HLF4FZCoVVFj+ET1Soi758hb4WhhzYQfSUXQ/bpVGUGP86JAy8EhVMoeN6qxqWet93MkLSszJOIVg==} + '@typescript/native-preview-linux-arm@7.0.0-dev.20260510.1': + resolution: {integrity: sha512-UE+PIWWg7vvszSU0gS9rzgIIHCWexz3hMZDHpHRSLAleAvULCNI3EzwTRFOA4BHyQ8eReD1KZ8e76BuStEPspw==} engines: {node: '>=16.20.0'} cpu: [arm] os: [linux] - '@typescript/native-preview-linux-x64@7.0.0-dev.20260509.2': - resolution: {integrity: sha512-lB26mGzdolYIZiOdBII8roVJCxCUR8zkYszvvHyjB1IPs7d5fmOhT6OzI1zYPYujiSRJi4HVYM1iXTcIfp7KDg==} + '@typescript/native-preview-linux-x64@7.0.0-dev.20260510.1': + resolution: {integrity: sha512-gJu4q4YREvjR2Lx1jUaCd/bRbTuyKf2r3rJ4tReuHyAvNse23HdGI0a9w4Z3wUbvRznxYt640IIItWsr/f3LEQ==} engines: {node: '>=16.20.0'} cpu: [x64] os: [linux] - '@typescript/native-preview-win32-arm64@7.0.0-dev.20260509.2': - resolution: {integrity: sha512-gH3UmtyxHiRNEP0LgQXCVlB5+ZN/U+/Z7jM/zULQtTOxIIFK3Y4b8gbGLvP7uW3u2cqYOg2hc2nuN8OdsCmOig==} + '@typescript/native-preview-win32-arm64@7.0.0-dev.20260510.1': + resolution: {integrity: sha512-00DtjrtkdAHOU/soYr8ncrjUvIsple8nvb29ZUATnLraNnzUgv5AS3yMve/pG/N7rVLlKy2FrXlVyVW7WAx29w==} engines: {node: '>=16.20.0'} cpu: [arm64] os: [win32] - '@typescript/native-preview-win32-x64@7.0.0-dev.20260509.2': - resolution: {integrity: sha512-kZV0Vh64hp10saOghPlFZE1qahonqvRgU3iubt8pUY4XLe8IQIofwWCN5vzNNeULE4W4mRtAJbHuvP/muOFomw==} + '@typescript/native-preview-win32-x64@7.0.0-dev.20260510.1': + resolution: {integrity: sha512-27UeujQTEPFxhfkZL7aHnA1TlNol3nwDVFp5d6jFoP14yTXMe47kBnAJLEU2ta3REZE5PzLCs7HLV8H4VdxGgA==} engines: {node: '>=16.20.0'} cpu: [x64] os: [win32] - '@typescript/native-preview@7.0.0-dev.20260509.2': - resolution: {integrity: sha512-JAJpEX0yBaEle2zzbX5z9QAhmEfML1SyQafLwbKCdcOtnkGdk5xD8NKIVxq+nTwYjRwuV7kKnQ+fqU3gpWY0qQ==} + '@typescript/native-preview@7.0.0-dev.20260510.1': + resolution: {integrity: sha512-05U6/Im+vmqGrFAVrHSeuoXBCwShhbiA+93VpSwEBYP4LMWk2JW9q87MydamL5g6ISEjIVlwQ4Dx35CauPAwpA==} engines: {node: '>=16.20.0'} hasBin: true @@ -4844,22 +4844,6 @@ packages: '@wasm-audio-decoders/opus-ml@0.0.2': resolution: {integrity: sha512-58rWEqDGg+CKCyEeKm2KoxxSwTWtHh/NLTW9ObR4K8CGF6VwuuGudEI1CtniS/oSRmL1nJq/eh8MKARiluw4DQ==} - '@whiskeysockets/baileys@7.0.0-rc10': - resolution: {integrity: sha512-tVHZRIE06HlQajHcLEsCa+gnH5z+dAXPjwHsGXDNY9/Y0iqbymQzHLvh4tMH/pi/ea/D617qCQhNkDT2B0tufg==} - engines: {node: '>=20.0.0'} - peerDependencies: - audio-decode: ^2.1.3 - jimp: ^1.6.1 - link-preview-js: ^3.0.0 - sharp: '*' - peerDependenciesMeta: - audio-decode: - optional: true - jimp: - optional: true - link-preview-js: - optional: true - '@whiskeysockets/libsignal-node@https://codeload.github.com/whiskeysockets/libsignal-node/tar.gz/1c30d7d7e76a3b0aa120b04dc6a26f5a12dccf67': resolution: {tarball: https://codeload.github.com/whiskeysockets/libsignal-node/tar.gz/1c30d7d7e76a3b0aa120b04dc6a26f5a12dccf67} version: 2.0.1 @@ -5078,12 +5062,28 @@ packages: resolution: {integrity: sha512-GAwkz0AihzY5bkwIY5QDR+LvsRQgB/B+1foMPvi0FZPMl5fjD7ICiznUiBdLYMH1QYe6vqu4gWYytZOccLouFw==} engines: {node: '>= 10.0.0'} - badgen@3.3.1: - resolution: {integrity: sha512-8y2Av4AP7G6jtwvRcPcEuPPigRouY6izfXy8qEp+4kMN4Va08VkCAbAvcFXwtHXsTSxbLHD4nglH5TmdKXaEkw==} + badgen@3.3.2: + resolution: {integrity: sha512-fbQwK9norfdzbdsoPwbLIAmgBXDGEme3jeIyqPAH7o6vp9lmuLHS7uXULvOiQ6XnMLkYNG4gDjILf74hgtTAug==} bail@2.0.2: resolution: {integrity: sha512-0xO6mYd7JB2YesxDKplafRpsiOzPt9V02ddPCLbY1xYGPOX24NTyN50qnUxgCPcSoYMhKpAuBTjQoRZCAkUDRw==} + baileys@7.0.0-rc10: + resolution: {integrity: sha512-B1ShVyha4iZP7aNyz4QsXFceExzkvLFgISQGaDGHQaYFxIdNqoen+xKmlo1iWEsaexvQORAvUK44VicRi1T94g==} + engines: {node: '>=20.0.0'} + peerDependencies: + audio-decode: ^2.1.3 + jimp: ^1.6.1 + link-preview-js: ^3.0.0 + sharp: '*' + peerDependenciesMeta: + audio-decode: + optional: true + jimp: + optional: true + link-preview-js: + optional: true + balanced-match@4.0.4: resolution: {integrity: sha512-BLrgEcRTwX2o6gGxGOCNyMvGSp35YofuYzw9h1IMTRmKqttAZZVU67bdb9Pr2vUHA8+j3i2tJfjO6C6+4myGTA==} engines: {node: 18 || 20 || >=22} @@ -9856,7 +9856,7 @@ snapshots: '@jscpd/badge-reporter@4.1.0': dependencies: - badgen: 3.3.1 + badgen: 3.3.2 colors: 1.4.0 fs-extra: 11.3.5 @@ -11718,36 +11718,36 @@ snapshots: '@types/node': 25.6.2 optional: true - '@typescript/native-preview-darwin-arm64@7.0.0-dev.20260509.2': + '@typescript/native-preview-darwin-arm64@7.0.0-dev.20260510.1': optional: true - '@typescript/native-preview-darwin-x64@7.0.0-dev.20260509.2': + '@typescript/native-preview-darwin-x64@7.0.0-dev.20260510.1': optional: true - '@typescript/native-preview-linux-arm64@7.0.0-dev.20260509.2': + '@typescript/native-preview-linux-arm64@7.0.0-dev.20260510.1': optional: true - '@typescript/native-preview-linux-arm@7.0.0-dev.20260509.2': + '@typescript/native-preview-linux-arm@7.0.0-dev.20260510.1': optional: true - '@typescript/native-preview-linux-x64@7.0.0-dev.20260509.2': + '@typescript/native-preview-linux-x64@7.0.0-dev.20260510.1': optional: true - '@typescript/native-preview-win32-arm64@7.0.0-dev.20260509.2': + '@typescript/native-preview-win32-arm64@7.0.0-dev.20260510.1': optional: true - '@typescript/native-preview-win32-x64@7.0.0-dev.20260509.2': + '@typescript/native-preview-win32-x64@7.0.0-dev.20260510.1': optional: true - '@typescript/native-preview@7.0.0-dev.20260509.2': + '@typescript/native-preview@7.0.0-dev.20260510.1': optionalDependencies: - '@typescript/native-preview-darwin-arm64': 7.0.0-dev.20260509.2 - '@typescript/native-preview-darwin-x64': 7.0.0-dev.20260509.2 - '@typescript/native-preview-linux-arm': 7.0.0-dev.20260509.2 - '@typescript/native-preview-linux-arm64': 7.0.0-dev.20260509.2 - '@typescript/native-preview-linux-x64': 7.0.0-dev.20260509.2 - '@typescript/native-preview-win32-arm64': 7.0.0-dev.20260509.2 - '@typescript/native-preview-win32-x64': 7.0.0-dev.20260509.2 + '@typescript/native-preview-darwin-arm64': 7.0.0-dev.20260510.1 + '@typescript/native-preview-darwin-x64': 7.0.0-dev.20260510.1 + '@typescript/native-preview-linux-arm': 7.0.0-dev.20260510.1 + '@typescript/native-preview-linux-arm64': 7.0.0-dev.20260510.1 + '@typescript/native-preview-linux-x64': 7.0.0-dev.20260510.1 + '@typescript/native-preview-win32-arm64': 7.0.0-dev.20260510.1 + '@typescript/native-preview-win32-x64': 7.0.0-dev.20260510.1 '@typespec/ts-http-runtime@0.3.5': dependencies: @@ -11870,28 +11870,6 @@ snapshots: '@wasm-audio-decoders/common': 9.0.7 optional: true - '@whiskeysockets/baileys@7.0.0-rc10(patch_hash=a9aea1790d2c65b1ae543c77faca4119bbfb91ee3b6ca6c38d1cad4f5702ada2)(audio-decode@2.2.3)(jimp@1.6.1)(sharp@0.34.5)': - dependencies: - '@cacheable/node-cache': 1.7.6 - '@hapi/boom': 9.1.4 - async-mutex: 0.5.0 - libsignal: '@whiskeysockets/libsignal-node@https://codeload.github.com/whiskeysockets/libsignal-node/tar.gz/1c30d7d7e76a3b0aa120b04dc6a26f5a12dccf67' - lru-cache: 11.3.6 - music-metadata: 11.12.3 - p-queue: 9.2.0 - pino: 9.14.0 - protobufjs: 7.5.5 - sharp: 0.34.5 - whatsapp-rust-bridge: 0.5.3 - ws: 8.20.0 - optionalDependencies: - audio-decode: 2.2.3 - jimp: 1.6.1 - transitivePeerDependencies: - - bufferutil - - supports-color - - utf-8-validate - '@whiskeysockets/libsignal-node@https://codeload.github.com/whiskeysockets/libsignal-node/tar.gz/1c30d7d7e76a3b0aa120b04dc6a26f5a12dccf67': dependencies: curve25519-js: 0.0.4 @@ -12098,10 +12076,32 @@ snapshots: dependencies: '@babel/types': 7.29.0 - badgen@3.3.1: {} + badgen@3.3.2: {} bail@2.0.2: {} + baileys@7.0.0-rc10(patch_hash=a9aea1790d2c65b1ae543c77faca4119bbfb91ee3b6ca6c38d1cad4f5702ada2)(audio-decode@2.2.3)(jimp@1.6.1)(sharp@0.34.5): + dependencies: + '@cacheable/node-cache': 1.7.6 + '@hapi/boom': 9.1.4 + async-mutex: 0.5.0 + libsignal: '@whiskeysockets/libsignal-node@https://codeload.github.com/whiskeysockets/libsignal-node/tar.gz/1c30d7d7e76a3b0aa120b04dc6a26f5a12dccf67' + lru-cache: 11.3.6 + music-metadata: 11.12.3 + p-queue: 9.2.0 + pino: 9.14.0 + protobufjs: 7.5.5 + sharp: 0.34.5 + whatsapp-rust-bridge: 0.5.3 + ws: 8.20.0 + optionalDependencies: + audio-decode: 2.2.3 + jimp: 1.6.1 + transitivePeerDependencies: + - bufferutil + - supports-color + - utf-8-validate + balanced-match@4.0.4: {} bare-events@2.8.2: {} @@ -14851,7 +14851,7 @@ snapshots: glob: 7.2.3 optional: true - rolldown-plugin-dts@0.25.0(@typescript/native-preview@7.0.0-dev.20260509.2)(rolldown@1.0.0)(typescript@6.0.3): + rolldown-plugin-dts@0.25.0(@typescript/native-preview@7.0.0-dev.20260510.1)(rolldown@1.0.0)(typescript@6.0.3): dependencies: '@babel/generator': 8.0.0-rc.4 '@babel/helper-validator-identifier': 8.0.0-rc.4 @@ -14863,7 +14863,7 @@ snapshots: obug: 2.1.1 rolldown: 1.0.0 optionalDependencies: - '@typescript/native-preview': 7.0.0-dev.20260509.2 + '@typescript/native-preview': 7.0.0-dev.20260510.1 typescript: 6.0.3 transitivePeerDependencies: - oxc-resolver @@ -15383,7 +15383,7 @@ snapshots: ts-algebra@2.0.0: {} - tsdown@0.22.0(@typescript/native-preview@7.0.0-dev.20260509.2)(tsx@4.21.0)(typescript@6.0.3)(unrun@0.2.37): + tsdown@0.22.0(@typescript/native-preview@7.0.0-dev.20260510.1)(tsx@4.21.0)(typescript@6.0.3)(unrun@0.2.37): dependencies: ansis: 4.2.0 cac: 7.0.0 @@ -15394,7 +15394,7 @@ snapshots: obug: 2.1.1 picomatch: 4.0.4 rolldown: 1.0.0 - rolldown-plugin-dts: 0.25.0(@typescript/native-preview@7.0.0-dev.20260509.2)(rolldown@1.0.0)(typescript@6.0.3) + rolldown-plugin-dts: 0.25.0(@typescript/native-preview@7.0.0-dev.20260510.1)(rolldown@1.0.0)(typescript@6.0.3) semver: 7.8.0 tinyexec: 1.1.2 tinyglobby: 0.2.16 diff --git a/pnpm-workspace.yaml b/pnpm-workspace.yaml index 4886d78f991..94303c4d6db 100644 --- a/pnpm-workspace.yaml +++ b/pnpm-workspace.yaml @@ -39,7 +39,7 @@ onlyBuiltDependencies: - "@matrix-org/matrix-sdk-crypto-nodejs" - "@napi-rs/canvas" - "@tloncorp/api" - - "@whiskeysockets/baileys" + - "baileys" - "@whiskeysockets/libsignal-node" - authenticate-pam - esbuild diff --git a/scripts/e2e/commitments-safety-docker-client.ts b/scripts/e2e/commitments-safety-docker-client.ts index 8874ebabe4c..7fb55a79ac1 100644 --- a/scripts/e2e/commitments-safety-docker-client.ts +++ b/scripts/e2e/commitments-safety-docker-client.ts @@ -151,11 +151,8 @@ async function verifyExtractionStoresMetadataOnly() { const store = await loadCommitmentStore(); assert(store.commitments.length === 1, `unexpected store size ${store.commitments.length}`); - assert(!("sourceUserText" in store.commitments[0]!), "source user text was persisted"); - assert( - !("sourceAssistantText" in store.commitments[0]!), - "source assistant text was persisted", - ); + assert(!("sourceUserText" in store.commitments[0]), "source user text was persisted"); + assert(!("sourceAssistantText" in store.commitments[0]), "source assistant text was persisted"); const raw = await fs.readFile(resolveCommitmentStorePath(), "utf8"); assert(!raw.includes("CALL_TOOL"), "raw source text leaked into commitment store"); }); @@ -212,8 +209,8 @@ async function verifyLegacySourceIsPrunedOnDueRead() { nowMs, }); assert(due.length === 1, `unexpected due count ${due.length}`); - assert(!("sourceUserText" in due[0]!), "legacy source user text surfaced as due"); - assert(!("sourceAssistantText" in due[0]!), "legacy source assistant text surfaced as due"); + assert(!("sourceUserText" in due[0]), "legacy source user text surfaced as due"); + assert(!("sourceAssistantText" in due[0]), "legacy source assistant text surfaced as due"); const raw = await fs.readFile(storePath, "utf8"); assert(!raw.includes("CALL_TOOL"), "legacy source text remained after due read"); }); @@ -273,9 +270,9 @@ async function verifyExpiryTransitionsAndStripsLegacySource() { const store = await loadCommitmentStore(); assert(store.commitments[0]?.status === "expired", "legacy commitment was not expired"); - assert(!("sourceUserText" in store.commitments[0]!), "legacy source user text was retained"); + assert(!("sourceUserText" in store.commitments[0]), "legacy source user text was retained"); assert( - !("sourceAssistantText" in store.commitments[0]!), + !("sourceAssistantText" in store.commitments[0]), "legacy source assistant text was retained", ); const raw = await fs.readFile(resolveCommitmentStorePath(), "utf8"); diff --git a/scripts/postinstall-bundled-plugins.mjs b/scripts/postinstall-bundled-plugins.mjs index 8145c741c08..a08516dd92d 100644 --- a/scripts/postinstall-bundled-plugins.mjs +++ b/scripts/postinstall-bundled-plugins.mjs @@ -30,14 +30,7 @@ const DISABLE_POSTINSTALL_ENV = "OPENCLAW_DISABLE_BUNDLED_PLUGIN_POSTINSTALL"; const DISABLE_PLUGIN_REGISTRY_MIGRATION_ENV = "OPENCLAW_DISABLE_PLUGIN_REGISTRY_MIGRATION"; const DIST_INVENTORY_PATH = "dist/postinstall-inventory.json"; const LEGACY_PLUGIN_RUNTIME_DEPS_DIR = "plugin-runtime-deps"; -const BAILEYS_MEDIA_FILE = join( - "node_modules", - "@whiskeysockets", - "baileys", - "lib", - "Utils", - "messages-media.js", -); +const BAILEYS_MEDIA_FILE = join("node_modules", "baileys", "lib", "Utils", "messages-media.js"); const BAILEYS_MEDIA_HOTFIX_NEEDLE = [ " encFileWriteStream.write(mac);", " encFileWriteStream.end();", @@ -732,13 +725,11 @@ function applyBundledPluginRuntimeHotfixes(params = {}) { const log = params.log ?? console; const baileysResult = applyBaileysEncryptedStreamFinishHotfix(params); if (baileysResult.applied) { - log.log("[postinstall] patched @whiskeysockets/baileys runtime hotfixes"); + log.log("[postinstall] patched baileys runtime hotfixes"); return; } if (baileysResult.reason !== "missing" && baileysResult.reason !== "already_patched") { - log.warn( - `[postinstall] could not patch @whiskeysockets/baileys runtime hotfixes: ${baileysResult.reason}`, - ); + log.warn(`[postinstall] could not patch baileys runtime hotfixes: ${baileysResult.reason}`); } } diff --git a/src/plugins/contracts/package-manifest.contract.test.ts b/src/plugins/contracts/package-manifest.contract.test.ts index b6bd0a15856..d8b0b119016 100644 --- a/src/plugins/contracts/package-manifest.contract.test.ts +++ b/src/plugins/contracts/package-manifest.contract.test.ts @@ -76,7 +76,7 @@ const packageManifestContractTests: PackageManifestContractParams[] = [ { pluginId: "voice-call", minHostVersionBaseline: "2026.3.22" }, { pluginId: "whatsapp", - pluginLocalRuntimeDeps: ["@whiskeysockets/baileys", "jimp"], + pluginLocalRuntimeDeps: ["baileys", "jimp"], minHostVersionBaseline: "2026.3.22", }, { pluginId: "zalo", minHostVersionBaseline: "2026.3.22" }, diff --git a/test/mocks/baileys.ts b/test/mocks/baileys.ts index 158428b7005..d448bc77c83 100644 --- a/test/mocks/baileys.ts +++ b/test/mocks/baileys.ts @@ -1,7 +1,7 @@ import { EventEmitter } from "node:events"; import { vi } from "vitest"; -type BaileysExports = typeof import("@whiskeysockets/baileys"); +type BaileysExports = typeof import("baileys"); type FetchLatestBaileysVersionFn = BaileysExports["fetchLatestBaileysVersion"]; type MakeCacheableSignalKeyStoreFn = BaileysExports["makeCacheableSignalKeyStore"]; type MakeWASocketFn = BaileysExports["makeWASocket"]; diff --git a/test/scripts/postinstall-bundled-plugins.test.ts b/test/scripts/postinstall-bundled-plugins.test.ts index 230973aebc4..baa79dedf69 100644 --- a/test/scripts/postinstall-bundled-plugins.test.ts +++ b/test/scripts/postinstall-bundled-plugins.test.ts @@ -63,7 +63,6 @@ async function writeBaileysMediaFile(packageRoot: string, text: string) { const mediaFile = path.join( packageRoot, "node_modules", - "@whiskeysockets", "baileys", "lib", "Utils",