@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 +1 -1
- package/src/channel.ts +7 -3
- package/src/config-schema.ts +13 -9
- package/src/monitor-normalize.ts +1 -1
- package/src/onboarding.ts +9 -28
- package/src/runtime.ts +7 -12
package/package.json
CHANGED
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
|
-
|
|
373
|
-
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
|
|
386
|
+
statusSink,
|
|
383
387
|
webhookPath,
|
|
384
388
|
});
|
|
385
389
|
},
|
package/src/config-schema.ts
CHANGED
|
@@ -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:
|
|
37
|
-
allowFrom:
|
|
38
|
-
groupAllowFrom:
|
|
39
|
-
groupPolicy:
|
|
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 =
|
|
64
|
-
|
|
65
|
-
|
|
67
|
+
export const BlueBubblesConfigSchema = buildCatchallMultiAccountChannelSchema(
|
|
68
|
+
bluebubblesAccountSchema,
|
|
69
|
+
).extend({
|
|
66
70
|
actions: bluebubblesActionSchema,
|
|
67
71
|
});
|
package/src/monitor-normalize.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { parseFiniteNumber } from "
|
|
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
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
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
|
-
|
|
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
|
-
|
|
9
|
+
runtimeStore.clearRuntime();
|
|
12
10
|
}
|
|
13
11
|
|
|
14
12
|
export function tryGetBlueBubblesRuntime(): PluginRuntime | null {
|
|
15
|
-
return
|
|
13
|
+
return runtimeStore.tryGetRuntime();
|
|
16
14
|
}
|
|
17
15
|
|
|
18
16
|
export function getBlueBubblesRuntime(): PluginRuntime {
|
|
19
|
-
|
|
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 = (
|
|
23
|
+
const log = (runtimeStore.tryGetRuntime() as unknown as LegacyRuntimeLogShape | null)?.log;
|
|
29
24
|
if (typeof log === "function") {
|
|
30
25
|
log(formatted);
|
|
31
26
|
return;
|