mirror of
https://github.com/openclaw/openclaw.git
synced 2026-06-06 05:51:15 +08:00
chore(deps): update whatsapp baileys
This commit is contained in:
@@ -16,6 +16,7 @@ Docs: https://docs.openclaw.ai
|
||||
|
||||
### Fixes
|
||||
|
||||
- WhatsApp: update Baileys to `7.0.0-rc12`.
|
||||
- Dependencies: update `@openclaw/fs-safe` to `0.2.7` so OpenClaw's default Python-helper-off policy keeps best-effort Node write fallbacks for private stores, secret writes, run logs, and media attachments on Linux/macOS.
|
||||
- Browser: honor the configured image sanitization limit for screenshots and labeled snapshots so browser-captured images follow the same resize policy as other image results. (#84595)
|
||||
- Status: show the configured default, session-selected model, reason, clear hint, and docs link when a session remains pinned to a model that differs from `agents.defaults.model.primary`.
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
"type": "module",
|
||||
"dependencies": {
|
||||
"audio-decode": "2.2.3",
|
||||
"baileys": "7.0.0-rc11",
|
||||
"baileys": "7.0.0-rc12",
|
||||
"https-proxy-agent": "9.0.0",
|
||||
"jimp": "1.6.1",
|
||||
"typebox": "1.1.38"
|
||||
|
||||
@@ -1,28 +0,0 @@
|
||||
diff --git a/lib/Utils/messages-media.js b/lib/Utils/messages-media.js
|
||||
index 95f8c63..612b7fb 100644
|
||||
--- a/lib/Utils/messages-media.js
|
||||
+++ b/lib/Utils/messages-media.js
|
||||
@@ -596,7 +596,10 @@ const uploadWithFetch = async ({ url, filePath, headers, timeoutMs, agent }) =>
|
||||
const nodeStream = createReadStream(filePath);
|
||||
const webStream = Readable.toWeb(nodeStream);
|
||||
const response = await fetch(url, {
|
||||
- dispatcher: agent,
|
||||
+ // Baileys may pass a generic agent in some runtimes. Undici's dispatcher
|
||||
+ // option only accepts Dispatcher-compatible implementations, so only wire
|
||||
+ // it through when the object actually implements dispatch.
|
||||
+ ...(typeof agent?.dispatch === 'function' ? { dispatcher: agent } : {}),
|
||||
method: 'POST',
|
||||
body: webStream,
|
||||
headers,
|
||||
diff --git a/lib/Utils/logger.d.ts b/lib/Utils/logger.d.ts
|
||||
index 4d78996..059f58f 100644
|
||||
--- a/lib/Utils/logger.d.ts
|
||||
+++ b/lib/Utils/logger.d.ts
|
||||
@@ -7,6 +7,6 @@ export interface ILogger {
|
||||
info(obj: unknown, msg?: string): void;
|
||||
warn(obj: unknown, msg?: string): void;
|
||||
error(obj: unknown, msg?: string): void;
|
||||
}
|
||||
-declare const _default: import("pino").Logger<never, boolean>;
|
||||
+declare const _default: ILogger;
|
||||
export default _default;
|
||||
12
patches/baileys@7.0.0-rc12.patch
Normal file
12
patches/baileys@7.0.0-rc12.patch
Normal file
@@ -0,0 +1,12 @@
|
||||
diff --git a/lib/Utils/logger.d.ts b/lib/Utils/logger.d.ts
|
||||
index 4d78996..059f58f 100644
|
||||
--- a/lib/Utils/logger.d.ts
|
||||
+++ b/lib/Utils/logger.d.ts
|
||||
@@ -7,6 +7,6 @@ export interface ILogger {
|
||||
info(obj: unknown, msg?: string): void;
|
||||
warn(obj: unknown, msg?: string): void;
|
||||
error(obj: unknown, msg?: string): void;
|
||||
}
|
||||
-declare const _default: import("pino").Logger<never, boolean>;
|
||||
+declare const _default: ILogger;
|
||||
export default _default;
|
||||
12
pnpm-lock.yaml
generated
12
pnpm-lock.yaml
generated
@@ -35,7 +35,7 @@ packageExtensionsChecksum: sha256-oc/FAHkBR844HBfph1RZWyRMHHBpIFya25tyv5SGf6s=
|
||||
|
||||
patchedDependencies:
|
||||
'@agentclientprotocol/claude-agent-acp@0.33.1': 3995624bb834cc60fea1461c7ef33f1fcdd8fb58b8f43f2f1490bc689f6e1be2
|
||||
baileys@7.0.0-rc11: a9aea1790d2c65b1ae543c77faca4119bbfb91ee3b6ca6c38d1cad4f5702ada2
|
||||
baileys@7.0.0-rc12: f2bd4db8403598ce9e4efafe859a27443a41c5ce25d97218de69169b4c03e18c
|
||||
|
||||
importers:
|
||||
|
||||
@@ -1651,8 +1651,8 @@ importers:
|
||||
specifier: 2.2.3
|
||||
version: 2.2.3
|
||||
baileys:
|
||||
specifier: 7.0.0-rc11
|
||||
version: 7.0.0-rc11(patch_hash=a9aea1790d2c65b1ae543c77faca4119bbfb91ee3b6ca6c38d1cad4f5702ada2)(audio-decode@2.2.3)(jimp@1.6.1)(sharp@0.34.5)
|
||||
specifier: 7.0.0-rc12
|
||||
version: 7.0.0-rc12(patch_hash=f2bd4db8403598ce9e4efafe859a27443a41c5ce25d97218de69169b4c03e18c)(audio-decode@2.2.3)(jimp@1.6.1)(sharp@0.34.5)
|
||||
https-proxy-agent:
|
||||
specifier: 9.0.0
|
||||
version: 9.0.0
|
||||
@@ -4741,8 +4741,8 @@ packages:
|
||||
bail@2.0.2:
|
||||
resolution: {integrity: sha512-0xO6mYd7JB2YesxDKplafRpsiOzPt9V02ddPCLbY1xYGPOX24NTyN50qnUxgCPcSoYMhKpAuBTjQoRZCAkUDRw==}
|
||||
|
||||
baileys@7.0.0-rc11:
|
||||
resolution: {integrity: sha512-yi7An4f5DmShjb75L8eSttrA6HLy7PYoP3XIQBmvQ5yH8vVZWBXZDogDxfGQQL6N98ELRwznG7puhjyLEa5CQg==}
|
||||
baileys@7.0.0-rc12:
|
||||
resolution: {integrity: sha512-kttfToIBUKJb5hn57GspFbtlGaOp8wwhij7F8JRtduIL6vIODL5ze7XnsQKT73QwgFOGdJYXAT01x6rz9NNijg==}
|
||||
engines: {node: '>=20.0.0'}
|
||||
peerDependencies:
|
||||
audio-decode: ^2.1.3
|
||||
@@ -10806,7 +10806,7 @@ snapshots:
|
||||
|
||||
bail@2.0.2: {}
|
||||
|
||||
baileys@7.0.0-rc11(patch_hash=a9aea1790d2c65b1ae543c77faca4119bbfb91ee3b6ca6c38d1cad4f5702ada2)(audio-decode@2.2.3)(jimp@1.6.1)(sharp@0.34.5):
|
||||
baileys@7.0.0-rc12(patch_hash=f2bd4db8403598ce9e4efafe859a27443a41c5ce25d97218de69169b4c03e18c)(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
|
||||
|
||||
@@ -14,7 +14,7 @@ minimumReleaseAgeExclude:
|
||||
- "@agentclientprotocol/sdk"
|
||||
- "axios"
|
||||
- "basic-ftp"
|
||||
- "baileys@7.0.0-rc11"
|
||||
- "baileys@7.0.0-rc12"
|
||||
- "hono"
|
||||
- "libsignal@6.0.0"
|
||||
- "openclaw"
|
||||
@@ -105,4 +105,4 @@ peerDependencyRules:
|
||||
|
||||
patchedDependencies:
|
||||
"@agentclientprotocol/claude-agent-acp@0.33.1": "patches/@agentclientprotocol__claude-agent-acp@0.33.1.patch"
|
||||
"baileys@7.0.0-rc11": "patches/baileys@7.0.0-rc11.patch"
|
||||
"baileys@7.0.0-rc12": "patches/baileys@7.0.0-rc12.patch"
|
||||
|
||||
@@ -11,7 +11,7 @@ const ALLOWED_PATCHED_DEPENDENCIES = new Map([
|
||||
"@agentclientprotocol/claude-agent-acp@0.33.1",
|
||||
"patches/@agentclientprotocol__claude-agent-acp@0.33.1.patch",
|
||||
],
|
||||
["baileys@7.0.0-rc11", "patches/baileys@7.0.0-rc11.patch"],
|
||||
["baileys@7.0.0-rc12", "patches/baileys@7.0.0-rc12.patch"],
|
||||
]);
|
||||
|
||||
const ALLOWED_PATCH_FILES = new Set(["patches/.gitkeep", ...ALLOWED_PATCHED_DEPENDENCIES.values()]);
|
||||
|
||||
@@ -651,7 +651,11 @@ export function applyBaileysEncryptedStreamFinishHotfix(params = {}) {
|
||||
) ||
|
||||
patchedText.includes(
|
||||
"...(typeof agent?.dispatch === 'function' ? { dispatcher: agent } : {}),",
|
||||
);
|
||||
) ||
|
||||
(patchedText.includes(
|
||||
"const dispatcher = typeof agent?.dispatch === 'function' ? agent : undefined;",
|
||||
) &&
|
||||
patchedText.includes("...(dispatcher ? { dispatcher } : {}),"));
|
||||
const legacyDispatcherPatchable =
|
||||
patchedText.includes(BAILEYS_MEDIA_DISPATCHER_NEEDLE) &&
|
||||
patchedText.includes(BAILEYS_MEDIA_DISPATCHER_HEADER_NEEDLE);
|
||||
|
||||
@@ -59,7 +59,7 @@ describe("check-package-patches", () => {
|
||||
`packages:
|
||||
- .
|
||||
patchedDependencies:
|
||||
"baileys@7.0.0-rc11": "patches/baileys@7.0.0-rc11.patch"
|
||||
"baileys@7.0.0-rc12": "patches/baileys@7.0.0-rc12.patch"
|
||||
"@agentclientprotocol/claude-agent-acp@0.33.1": "patches/@agentclientprotocol__claude-agent-acp@0.33.1.patch"
|
||||
`,
|
||||
"utf8",
|
||||
@@ -69,11 +69,11 @@ patchedDependencies:
|
||||
`lockfileVersion: '9.0'
|
||||
patchedDependencies:
|
||||
'@agentclientprotocol/claude-agent-acp@0.33.1': 3995624bb834cc60fea1461c7ef33f1fcdd8fb58b8f43f2f1490bc689f6e1be2
|
||||
baileys@7.0.0-rc11: a9aea1790d2c65b1ae543c77faca4119bbfb91ee3b6ca6c38d1cad4f5702ada2
|
||||
baileys@7.0.0-rc12: a9aea1790d2c65b1ae543c77faca4119bbfb91ee3b6ca6c38d1cad4f5702ada2
|
||||
`,
|
||||
"utf8",
|
||||
);
|
||||
writeFileSync(path.join(dir, "patches", "baileys@7.0.0-rc11.patch"), "diff\n", "utf8");
|
||||
writeFileSync(path.join(dir, "patches", "baileys@7.0.0-rc12.patch"), "diff\n", "utf8");
|
||||
writeFileSync(
|
||||
path.join(dir, "patches", "@agentclientprotocol__claude-agent-acp@0.33.1.patch"),
|
||||
"diff\n",
|
||||
|
||||
@@ -299,6 +299,40 @@ describe("bundled plugin postinstall", () => {
|
||||
});
|
||||
});
|
||||
|
||||
it("recognizes Baileys upload helpers with a prepared dispatcher", async () => {
|
||||
const packageRoot = await createTempDirAsync("openclaw-baileys-postinstall-");
|
||||
await writeBaileysMediaFile(
|
||||
packageRoot,
|
||||
[
|
||||
"import { once } from 'events';",
|
||||
"const encryptedStream = async () => {",
|
||||
" encFileWriteStream.write(mac);",
|
||||
" const encFinishPromise = once(encFileWriteStream, 'finish');",
|
||||
" const originalFinishPromise = originalFileStream ? once(originalFileStream, 'finish') : Promise.resolve();",
|
||||
" encFileWriteStream.end();",
|
||||
" originalFileStream?.end?.();",
|
||||
" stream.destroy();",
|
||||
" await encFinishPromise;",
|
||||
" await originalFinishPromise;",
|
||||
" logger?.debug('encrypted data successfully');",
|
||||
"};",
|
||||
"const uploadWithFetch = async ({ url, filePath, headers, timeoutMs, agent }) => {",
|
||||
" const dispatcher = typeof agent?.dispatch === 'function' ? agent : undefined;",
|
||||
" const response = await fetch(url, {",
|
||||
" ...(dispatcher ? { dispatcher } : {}),",
|
||||
" method: 'POST',",
|
||||
" });",
|
||||
"};",
|
||||
"",
|
||||
].join("\n"),
|
||||
);
|
||||
|
||||
expect(applyBaileysEncryptedStreamFinishHotfix({ packageRoot })).toEqual({
|
||||
applied: false,
|
||||
reason: "already_patched",
|
||||
});
|
||||
});
|
||||
|
||||
it("does not classify published packages with source files as source checkouts", () => {
|
||||
const packageRoot = "/pkg";
|
||||
const existingPaths = new Set([
|
||||
|
||||
Reference in New Issue
Block a user