@openclaw/bluebubbles 2026.3.7 → 2026.3.8-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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openclaw/bluebubbles",
3
- "version": "2026.3.7",
3
+ "version": "2026.3.8-beta.1",
4
4
  "description": "OpenClaw BlueBubbles channel plugin",
5
5
  "type": "module",
6
6
  "dependencies": {
@@ -1,9 +1,11 @@
1
1
  import { MarkdownConfigSchema, ToolPolicySchema } from "openclaw/plugin-sdk/bluebubbles";
2
+ import {
3
+ AllowFromEntrySchema,
4
+ buildCatchallMultiAccountChannelSchema,
5
+ } from "openclaw/plugin-sdk/compat";
2
6
  import { z } from "zod";
3
7
  import { buildSecretInputSchema, hasConfiguredSecretInput } from "./secret-input.js";
4
8
 
5
- const allowFromEntry = z.union([z.string(), z.number()]);
6
-
7
9
  const bluebubblesActionSchema = z
8
10
  .object({
9
11
  reactions: z.boolean().default(true),
@@ -34,8 +36,8 @@ const bluebubblesAccountSchema = z
34
36
  password: buildSecretInputSchema().optional(),
35
37
  webhookPath: z.string().optional(),
36
38
  dmPolicy: z.enum(["pairing", "allowlist", "open", "disabled"]).optional(),
37
- allowFrom: z.array(allowFromEntry).optional(),
38
- groupAllowFrom: z.array(allowFromEntry).optional(),
39
+ allowFrom: z.array(AllowFromEntrySchema).optional(),
40
+ groupAllowFrom: z.array(AllowFromEntrySchema).optional(),
39
41
  groupPolicy: z.enum(["open", "disabled", "allowlist"]).optional(),
40
42
  historyLimit: z.number().int().min(0).optional(),
41
43
  dmHistoryLimit: z.number().int().min(0).optional(),
@@ -60,8 +62,8 @@ const bluebubblesAccountSchema = z
60
62
  }
61
63
  });
62
64
 
63
- export const BlueBubblesConfigSchema = bluebubblesAccountSchema.extend({
64
- accounts: z.object({}).catchall(bluebubblesAccountSchema).optional(),
65
- defaultAccount: z.string().optional(),
65
+ export const BlueBubblesConfigSchema = buildCatchallMultiAccountChannelSchema(
66
+ bluebubblesAccountSchema,
67
+ ).extend({
66
68
  actions: bluebubblesActionSchema,
67
69
  });
@@ -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/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;