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
+14 -1
View File
@@ -1,6 +1,6 @@
import type { Config } from '../config/index.js';
import type { HookEngine } from '../hooks/index.js';
import { ChannelRegistry, TelegramAdapter, WebChatAdapter, DiscordAdapter, SlackAdapter, WhatsAppAdapter, MatrixAdapter, SignalAdapter, TeamsAdapter, PairingManager } from '../channels/index.js';
import { ChannelRegistry, TelegramAdapter, WebChatAdapter, DiscordAdapter, SlackAdapter, WhatsAppAdapter, MatrixAdapter, SignalAdapter, TeamsAdapter, GoogleChatAdapter, PairingManager } from '../channels/index.js';
import { CronScheduler, WebhookHandler, GmailWatcher } from '../automation/index.js';
import type { GatewayServer } from '../gateway/index.js';
@@ -113,6 +113,19 @@ export function registerChannels(deps: ChannelsDeps): ChannelsResult {
gateway.setTeamsHandler(teamsAdapter);
}
// Register Google Chat adapter (if configured)
if (config.google_chat) {
const googleChatAdapter = new GoogleChatAdapter({
serviceAccountKeyFile: config.google_chat.service_account_key_file,
serviceAccountJson: config.google_chat.service_account_json,
webhookToken: config.google_chat.webhook_token,
allowedSpaceNames: config.google_chat.allowed_space_names.length > 0 ? config.google_chat.allowed_space_names : undefined,
requireMention: config.google_chat.require_mention,
});
channelRegistry.register(googleChatAdapter);
gateway.setGoogleChatHandler(googleChatAdapter);
}
// Register WebChat adapter (wraps the gateway)
const webChatAdapter = new WebChatAdapter({ gateway });
channelRegistry.register(webChatAdapter);