feat(channels): add google chat adapter and webhook route

This commit is contained in:
William Valentin
2026-02-16 02:07:55 -08:00
parent 51ff5523ae
commit 693dcd8421
15 changed files with 463 additions and 3 deletions
+24
View File
@@ -375,6 +375,30 @@ describe('configSchema — teams', () => {
});
});
describe('configSchema — google_chat', () => {
const minimalConfig = {
telegram: { bot_token: 'test', allowed_chat_ids: [1] },
models: { default: { provider: 'anthropic', model: 'claude-3' } },
};
it('accepts google_chat config and defaults filters', () => {
const result = configSchema.parse({
...minimalConfig,
google_chat: {
service_account_key_file: '/tmp/gchat-service-account.json',
},
});
expect(result.google_chat).toBeDefined();
if (!result.google_chat) {
throw new Error('Expected google_chat config');
}
expect(result.google_chat.service_account_key_file).toBe('/tmp/gchat-service-account.json');
expect(result.google_chat.allowed_space_names).toEqual([]);
expect(result.google_chat.require_mention).toBe(true);
});
});
describe('configSchema — whatsapp', () => {
const minimalConfig = {
telegram: { bot_token: 'test', allowed_chat_ids: [1] },
+10
View File
@@ -418,6 +418,14 @@ const teamsSchema = z.object({
require_mention: z.boolean().default(true),
}).optional();
const googleChatSchema = z.object({
service_account_key_file: z.string().optional(),
service_account_json: z.string().optional(),
webhook_token: z.string().optional(),
allowed_space_names: z.array(z.string()).default([]),
require_mention: z.boolean().default(true),
}).optional();
const browserSchema = z.object({
enabled: z.boolean().default(false),
executable_path: z.string().optional(),
@@ -586,6 +594,7 @@ export const configSchema = z.object({
matrix: matrixSchema,
signal: signalSchema,
teams: teamsSchema,
google_chat: googleChatSchema,
server: serverSchema.default({}),
models: modelsSchema,
backends: backendsSchema.default({}),
@@ -632,6 +641,7 @@ export type WhatsAppConfig = z.infer<typeof whatsappSchema>;
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 RetryPolicyConfig = z.infer<typeof retrySchema>;
export type ContextLevel = z.infer<typeof contextLevelSchema>;
export type PromptConfig = z.infer<typeof promptSchema>;