@openclaw/bluebubbles 2026.2.14 → 2026.2.15

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openclaw/bluebubbles",
3
- "version": "2026.2.14",
3
+ "version": "2026.2.15",
4
4
  "description": "OpenClaw BlueBubbles channel plugin",
5
5
  "type": "module",
6
6
  "devDependencies": {
@@ -2,6 +2,7 @@ import type { OpenClawConfig } from "openclaw/plugin-sdk";
2
2
  import crypto from "node:crypto";
3
3
  import path from "node:path";
4
4
  import { resolveBlueBubblesAccount } from "./accounts.js";
5
+ import { postMultipartFormData } from "./multipart.js";
5
6
  import { getCachedBlueBubblesPrivateApiStatus } from "./probe.js";
6
7
  import { extractBlueBubblesMessageId, resolveBlueBubblesSendTarget } from "./send-helpers.js";
7
8
  import { resolveChatGuidForTarget } from "./send.js";
@@ -219,26 +220,12 @@ export async function sendBlueBubblesAttachment(params: {
219
220
  // Close the multipart body
220
221
  parts.push(encoder.encode(`--${boundary}--\r\n`));
221
222
 
222
- // Combine all parts into a single buffer
223
- const totalLength = parts.reduce((acc, part) => acc + part.length, 0);
224
- const body = new Uint8Array(totalLength);
225
- let offset = 0;
226
- for (const part of parts) {
227
- body.set(part, offset);
228
- offset += part.length;
229
- }
230
-
231
- const res = await blueBubblesFetchWithTimeout(
223
+ const res = await postMultipartFormData({
232
224
  url,
233
- {
234
- method: "POST",
235
- headers: {
236
- "Content-Type": `multipart/form-data; boundary=${boundary}`,
237
- },
238
- body,
239
- },
240
- opts.timeoutMs ?? 60_000, // longer timeout for file uploads
241
- );
225
+ boundary,
226
+ parts,
227
+ timeoutMs: opts.timeoutMs ?? 60_000, // longer timeout for file uploads
228
+ });
242
229
 
243
230
  if (!res.ok) {
244
231
  const errorText = await res.text();
package/src/chat.ts CHANGED
@@ -2,6 +2,7 @@ import type { OpenClawConfig } from "openclaw/plugin-sdk";
2
2
  import crypto from "node:crypto";
3
3
  import path from "node:path";
4
4
  import { resolveBlueBubblesAccount } from "./accounts.js";
5
+ import { postMultipartFormData } from "./multipart.js";
5
6
  import { getCachedBlueBubblesPrivateApiStatus } from "./probe.js";
6
7
  import { blueBubblesFetchWithTimeout, buildBlueBubblesApiUrl } from "./types.js";
7
8
 
@@ -376,26 +377,12 @@ export async function setGroupIconBlueBubbles(
376
377
  // Close multipart body
377
378
  parts.push(encoder.encode(`--${boundary}--\r\n`));
378
379
 
379
- // Combine into single buffer
380
- const totalLength = parts.reduce((acc, part) => acc + part.length, 0);
381
- const body = new Uint8Array(totalLength);
382
- let offset = 0;
383
- for (const part of parts) {
384
- body.set(part, offset);
385
- offset += part.length;
386
- }
387
-
388
- const res = await blueBubblesFetchWithTimeout(
380
+ const res = await postMultipartFormData({
389
381
  url,
390
- {
391
- method: "POST",
392
- headers: {
393
- "Content-Type": `multipart/form-data; boundary=${boundary}`,
394
- },
395
- body,
396
- },
397
- opts.timeoutMs ?? 60_000, // longer timeout for file uploads
398
- );
382
+ boundary,
383
+ parts,
384
+ timeoutMs: opts.timeoutMs ?? 60_000, // longer timeout for file uploads
385
+ });
399
386
 
400
387
  if (!res.ok) {
401
388
  const errorText = await res.text().catch(() => "");
@@ -0,0 +1,32 @@
1
+ import { blueBubblesFetchWithTimeout } from "./types.js";
2
+
3
+ export function concatUint8Arrays(parts: Uint8Array[]): Uint8Array {
4
+ const totalLength = parts.reduce((acc, part) => acc + part.length, 0);
5
+ const body = new Uint8Array(totalLength);
6
+ let offset = 0;
7
+ for (const part of parts) {
8
+ body.set(part, offset);
9
+ offset += part.length;
10
+ }
11
+ return body;
12
+ }
13
+
14
+ export async function postMultipartFormData(params: {
15
+ url: string;
16
+ boundary: string;
17
+ parts: Uint8Array[];
18
+ timeoutMs: number;
19
+ }): Promise<Response> {
20
+ const body = Buffer.from(concatUint8Arrays(params.parts));
21
+ return await blueBubblesFetchWithTimeout(
22
+ params.url,
23
+ {
24
+ method: "POST",
25
+ headers: {
26
+ "Content-Type": `multipart/form-data; boundary=${params.boundary}`,
27
+ },
28
+ body,
29
+ },
30
+ params.timeoutMs,
31
+ );
32
+ }
package/src/probe.ts CHANGED
@@ -1,9 +1,8 @@
1
+ import type { BaseProbeResult } from "openclaw/plugin-sdk";
1
2
  import { buildBlueBubblesApiUrl, blueBubblesFetchWithTimeout } from "./types.js";
2
3
 
3
- export type BlueBubblesProbe = {
4
- ok: boolean;
4
+ export type BlueBubblesProbe = BaseProbeResult & {
5
5
  status?: number | null;
6
- error?: string | null;
7
6
  };
8
7
 
9
8
  export type BlueBubblesServerInfo = {