feat(channels): add bluebubbles imessage adapter

This commit is contained in:
William Valentin
2026-02-16 09:41:26 -08:00
parent 2cadff901d
commit 8e9f9aa4de
13 changed files with 409 additions and 2 deletions
+25
View File
@@ -399,6 +399,31 @@ describe('configSchema — google_chat', () => {
});
});
describe('configSchema — bluebubbles', () => {
const minimalConfig = {
telegram: { bot_token: 'test', allowed_chat_ids: [1] },
models: { default: { provider: 'anthropic', model: 'claude-3' } },
};
it('accepts bluebubbles config and defaults optional fields', () => {
const result = configSchema.parse({
...minimalConfig,
bluebubbles: {
endpoint: 'http://localhost:1234',
api_key: 'bb-key',
},
});
expect(result.bluebubbles).toBeDefined();
if (!result.bluebubbles) {
throw new Error('Expected bluebubbles config');
}
expect(result.bluebubbles.allowed_chat_guids).toEqual([]);
expect(result.bluebubbles.require_mention).toBe(true);
expect(result.bluebubbles.mention_name).toBe('flynn');
});
});
describe('configSchema — whatsapp', () => {
const minimalConfig = {
telegram: { bot_token: 'test', allowed_chat_ids: [1] },
+11
View File
@@ -426,6 +426,15 @@ const googleChatSchema = z.object({
require_mention: z.boolean().default(true),
}).optional();
const bluebubblesSchema = z.object({
endpoint: z.string().url('BlueBubbles endpoint must be a valid URL'),
api_key: z.string().min(1, 'BlueBubbles api_key is required'),
webhook_token: z.string().optional(),
allowed_chat_guids: z.array(z.string()).default([]),
require_mention: z.boolean().default(true),
mention_name: z.string().default('flynn'),
}).optional();
const browserSchema = z.object({
enabled: z.boolean().default(false),
executable_path: z.string().optional(),
@@ -595,6 +604,7 @@ export const configSchema = z.object({
signal: signalSchema,
teams: teamsSchema,
google_chat: googleChatSchema,
bluebubbles: bluebubblesSchema,
server: serverSchema.default({}),
models: modelsSchema,
backends: backendsSchema.default({}),
@@ -642,6 +652,7 @@ export type MatrixConfig = z.infer<typeof matrixSchema>;
export type SignalConfig = z.infer<typeof signalSchema>;
export type TeamsConfig = z.infer<typeof teamsSchema>;
export type GoogleChatConfig = z.infer<typeof googleChatSchema>;
export type BlueBubblesConfig = z.infer<typeof bluebubblesSchema>;
export type RetryPolicyConfig = z.infer<typeof retrySchema>;
export type ContextLevel = z.infer<typeof contextLevelSchema>;
export type PromptConfig = z.infer<typeof promptSchema>;