Add LINE channel adapter with webhook ingress and gating

This commit is contained in:
William Valentin
2026-02-16 13:02:26 -08:00
parent a954d7e136
commit 76d44a74bf
15 changed files with 584 additions and 5 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, MattermostAdapter, TeamsAdapter, GoogleChatAdapter, BlueBubblesAdapter, PairingManager } from '../channels/index.js';
import { ChannelRegistry, TelegramAdapter, WebChatAdapter, DiscordAdapter, SlackAdapter, WhatsAppAdapter, MatrixAdapter, SignalAdapter, MattermostAdapter, TeamsAdapter, GoogleChatAdapter, BlueBubblesAdapter, LineAdapter, PairingManager } from '../channels/index.js';
import { CronScheduler, WebhookHandler, GmailWatcher } from '../automation/index.js';
import type { GatewayServer } from '../gateway/index.js';
@@ -154,6 +154,19 @@ export function registerChannels(deps: ChannelsDeps): ChannelsResult {
gateway.setBlueBubblesHandler(blueBubblesAdapter);
}
// Register LINE adapter (if configured)
if (config.line) {
const lineAdapter = new LineAdapter({
channelAccessToken: config.line.channel_access_token,
channelSecret: config.line.channel_secret,
allowedSourceIds: config.line.allowed_source_ids.length > 0 ? config.line.allowed_source_ids : undefined,
requireMention: config.line.require_mention,
mentionName: config.line.mention_name,
});
channelRegistry.register(lineAdapter);
gateway.setLineHandler(lineAdapter);
}
// Register WebChat adapter (wraps the gateway)
const webChatAdapter = new WebChatAdapter({ gateway });
channelRegistry.register(webChatAdapter);