@openclaw/bluebubbles 2026.3.7 → 2026.3.10

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.3.7",
3
+ "version": "2026.3.10",
4
4
  "description": "OpenClaw BlueBubbles channel plugin",
5
5
  "type": "module",
6
6
  "dependencies": {
package/src/channel.ts CHANGED
@@ -21,6 +21,7 @@ import {
21
21
  import {
22
22
  buildAccountScopedDmSecurityPolicy,
23
23
  collectOpenGroupPolicyRestrictSendersWarnings,
24
+ createAccountStatusSink,
24
25
  formatNormalizedAllowFromEntries,
25
26
  mapAllowFromEntries,
26
27
  } from "openclaw/plugin-sdk/compat";
@@ -369,8 +370,11 @@ export const bluebubblesPlugin: ChannelPlugin<ResolvedBlueBubblesAccount> = {
369
370
  startAccount: async (ctx) => {
370
371
  const account = ctx.account;
371
372
  const webhookPath = resolveWebhookPathFromConfig(account.config);
372
- ctx.setStatus({
373
- accountId: account.accountId,
373
+ const statusSink = createAccountStatusSink({
374
+ accountId: ctx.accountId,
375
+ setStatus: ctx.setStatus,
376
+ });
377
+ statusSink({
374
378
  baseUrl: account.baseUrl,
375
379
  });
376
380
  ctx.log?.info(`[${account.accountId}] starting provider (webhook=${webhookPath})`);
@@ -379,7 +383,7 @@ export const bluebubblesPlugin: ChannelPlugin<ResolvedBlueBubblesAccount> = {
379
383
  config: ctx.cfg,
380
384
  runtime: ctx.runtime,
381
385
  abortSignal: ctx.abortSignal,
382
- statusSink: (patch) => ctx.setStatus({ accountId: ctx.accountId, ...patch }),
386
+ statusSink,
383
387
  webhookPath,
384
388
  });
385
389
  },
@@ -1,9 +1,13 @@
1
1
  import { MarkdownConfigSchema, ToolPolicySchema } from "openclaw/plugin-sdk/bluebubbles";
2
+ import {
3
+ AllowFromListSchema,
4
+ buildCatchallMultiAccountChannelSchema,
5
+ DmPolicySchema,
6
+ GroupPolicySchema,
7
+ } from "openclaw/plugin-sdk/compat";
2
8
  import { z } from "zod";
3
9
  import { buildSecretInputSchema, hasConfiguredSecretInput } from "./secret-input.js";
4
10
 
5
- const allowFromEntry = z.union([z.string(), z.number()]);
6
-
7
11
  const bluebubblesActionSchema = z
8
12
  .object({
9
13
  reactions: z.boolean().default(true),
@@ -33,10 +37,10 @@ const bluebubblesAccountSchema = z
33
37
  serverUrl: z.string().optional(),
34
38
  password: buildSecretInputSchema().optional(),
35
39
  webhookPath: z.string().optional(),
36
- dmPolicy: z.enum(["pairing", "allowlist", "open", "disabled"]).optional(),
37
- allowFrom: z.array(allowFromEntry).optional(),
38
- groupAllowFrom: z.array(allowFromEntry).optional(),
39
- groupPolicy: z.enum(["open", "disabled", "allowlist"]).optional(),
40
+ dmPolicy: DmPolicySchema.optional(),
41
+ allowFrom: AllowFromListSchema,
42
+ groupAllowFrom: AllowFromListSchema,
43
+ groupPolicy: GroupPolicySchema.optional(),
40
44
  historyLimit: z.number().int().min(0).optional(),
41
45
  dmHistoryLimit: z.number().int().min(0).optional(),
42
46
  textChunkLimit: z.number().int().positive().optional(),
@@ -60,8 +64,8 @@ const bluebubblesAccountSchema = z
60
64
  }
61
65
  });
62
66
 
63
- export const BlueBubblesConfigSchema = bluebubblesAccountSchema.extend({
64
- accounts: z.object({}).catchall(bluebubblesAccountSchema).optional(),
65
- defaultAccount: z.string().optional(),
67
+ export const BlueBubblesConfigSchema = buildCatchallMultiAccountChannelSchema(
68
+ bluebubblesAccountSchema,
69
+ ).extend({
66
70
  actions: bluebubblesActionSchema,
67
71
  });
@@ -1,4 +1,4 @@
1
- import { parseFiniteNumber } from "../../../src/infra/parse-finite-number.js";
1
+ import { parseFiniteNumber } from "openclaw/plugin-sdk/bluebubbles";
2
2
  import { extractHandleFromChatGuid, normalizeBlueBubblesHandle } from "./targets.js";
3
3
  import type { BlueBubblesAttachment } from "./types.js";
4
4
 
package/src/onboarding.ts CHANGED
@@ -10,6 +10,7 @@ import {
10
10
  formatDocsLink,
11
11
  mergeAllowFromEntries,
12
12
  normalizeAccountId,
13
+ patchScopedAccountConfig,
13
14
  resolveAccountIdForConfigure,
14
15
  setTopLevelChannelDmPolicyWithAllowFrom,
15
16
  } from "openclaw/plugin-sdk/bluebubbles";
@@ -38,34 +39,14 @@ function setBlueBubblesAllowFrom(
38
39
  accountId: string,
39
40
  allowFrom: string[],
40
41
  ): OpenClawConfig {
41
- if (accountId === DEFAULT_ACCOUNT_ID) {
42
- return {
43
- ...cfg,
44
- channels: {
45
- ...cfg.channels,
46
- bluebubbles: {
47
- ...cfg.channels?.bluebubbles,
48
- allowFrom,
49
- },
50
- },
51
- };
52
- }
53
- return {
54
- ...cfg,
55
- channels: {
56
- ...cfg.channels,
57
- bluebubbles: {
58
- ...cfg.channels?.bluebubbles,
59
- accounts: {
60
- ...cfg.channels?.bluebubbles?.accounts,
61
- [accountId]: {
62
- ...cfg.channels?.bluebubbles?.accounts?.[accountId],
63
- allowFrom,
64
- },
65
- },
66
- },
67
- },
68
- };
42
+ return patchScopedAccountConfig({
43
+ cfg,
44
+ channelKey: channel,
45
+ accountId,
46
+ patch: { allowFrom },
47
+ ensureChannelEnabled: false,
48
+ ensureAccountEnabled: false,
49
+ });
69
50
  }
70
51
 
71
52
  function parseBlueBubblesAllowFromInput(raw: string): string[] {
package/src/runtime.ts CHANGED
@@ -1,31 +1,26 @@
1
1
  import type { PluginRuntime } from "openclaw/plugin-sdk/bluebubbles";
2
+ import { createPluginRuntimeStore } from "openclaw/plugin-sdk/compat";
2
3
 
3
- let runtime: PluginRuntime | null = null;
4
+ const runtimeStore = createPluginRuntimeStore<PluginRuntime>("BlueBubbles runtime not initialized");
4
5
  type LegacyRuntimeLogShape = { log?: (message: string) => void };
5
-
6
- export function setBlueBubblesRuntime(next: PluginRuntime): void {
7
- runtime = next;
8
- }
6
+ export const setBlueBubblesRuntime = runtimeStore.setRuntime;
9
7
 
10
8
  export function clearBlueBubblesRuntime(): void {
11
- runtime = null;
9
+ runtimeStore.clearRuntime();
12
10
  }
13
11
 
14
12
  export function tryGetBlueBubblesRuntime(): PluginRuntime | null {
15
- return runtime;
13
+ return runtimeStore.tryGetRuntime();
16
14
  }
17
15
 
18
16
  export function getBlueBubblesRuntime(): PluginRuntime {
19
- if (!runtime) {
20
- throw new Error("BlueBubbles runtime not initialized");
21
- }
22
- return runtime;
17
+ return runtimeStore.getRuntime();
23
18
  }
24
19
 
25
20
  export function warnBlueBubbles(message: string): void {
26
21
  const formatted = `[bluebubbles] ${message}`;
27
22
  // Backward-compatible with tests/legacy injections that pass { log }.
28
- const log = (runtime as unknown as LegacyRuntimeLogShape | null)?.log;
23
+ const log = (runtimeStore.tryGetRuntime() as unknown as LegacyRuntimeLogShape | null)?.log;
29
24
  if (typeof log === "function") {
30
25
  log(formatted);
31
26
  return;