feat(channels): add Facebook Messenger and Pancake channel integrations (#731)

Add two new channel implementations for Facebook Fanpage (comment + Messenger
auto-reply, first inbox DM) and Pancake/pages.fm (multi-platform inbox via
Facebook, Zalo, Instagram, TikTok, WhatsApp, LINE).

Key features:
- Facebook: comment auto-reply, Messenger auto-reply, first inbox DM,
  HMAC-SHA256 webhook verification, multi-page webhook routing
- Pancake: multi-platform inbox, outbound echo dedup with HTML normalization,
  race-condition-safe echo fingerprinting, platform-aware formatting
- Bootstrap skip: pre-fill USER.md from channel metadata (Pancake)
- SanitizeDisplayName across all channels (defense in depth)

Code audit fixes:
- Fix truncateForTikTok byte→rune slicing (UTF-8 corruption)
- Fix empty message.ID shared dedup slot (silent message loss)
- Fix DisplayName markdown injection in buildPrefilledUser
- Consolidate duplicate ChannelMeta type (agent→bootstrap)
- Compile-time interface assertions, alphabetical type constants
- Per-message logs demoted to slog.Debug, errors.As for wrapped errors
- UI: alphabetical channel ordering, complete config schemas
- Remove deprecated WhatsApp bridge_url, fix nested error parsing
This commit is contained in:
Plateau Nguyen authored and GitHub committed 2026-04-09 23:15:08 +07:00
1 parent 7205e6bb3b
commit fb8afd41bf
44 files changed
+4214 -39

No files matched your search

+1 -1
View File
@@ -169,7 +169,7 @@ func (c *Channel) handleMessageEvent(ctx context.Context, event *MessageEvent) {
"message_id": messageID,
"chat_type": mc.ChatType,
"sender_name": senderName,
"display_name": senderName,
"display_name": channels.SanitizeDisplayName(senderName),
"mentioned_bot": fmt.Sprintf("%t", mc.MentionedBot),
"platform": channels.TypeFeishu,
}