1.8 KiB
1.8 KiB
Feishu Channel Adapter Checklist
Date: 2026-02-16
Scope: Implement Feishu/Lark adapter as the second item in the LINE/Feishu/Zalo channel gap set.
Goal
Add a Feishu channel adapter with webhook ingress, outbound send path, mention/allowlist gating, and runtime wiring through daemon + gateway.
Implemented
- Added Feishu adapter:
src/channels/feishu/adapter.tssrc/channels/feishu/index.ts
- Inbound webhook handling:
- endpoint:
POST /feishu/events - supports Feishu URL verification challenge flow.
- validates
header.tokenwhenwebhook_tokenis configured.
- endpoint:
- Message normalization:
- handles
im.message.receive_v1text messages. - parses
message.contentJSON{ "text": "..." }. - emits normalized
InboundMessagewithmetadata.replyPeerId.
- handles
- Outbound messaging:
- obtains tenant access token via internal app credentials.
- sends text messages via Feishu IM v1 messages API.
- Gating:
- optional chat allowlist (
allowed_chat_ids). - mention policy (
require_mention,mention_name) with DM bypass.
- optional chat allowlist (
- Runtime integration:
- config schema + defaults for
feishu. - daemon registration and gateway handler binding.
- gateway route wiring + services discovery visibility.
- config schema + defaults for
Tests
src/channels/feishu/adapter.test.ts- name/status
- outbound token + send path
- url verification handling
- inbound event normalization
- webhook token enforcement
src/daemon/channels.test.ts- adapter registration + gateway
setFeishuHandlerbinding
- adapter registration + gateway
src/config/schema.test.ts- feishu config parsing/defaults
src/gateway/handlers/services.test.tsfeishuservice presence
Validation Run
pnpm test:run src/channels/feishu/adapter.test.ts src/daemon/channels.test.ts src/config/schema.test.ts src/gateway/handlers/services.test.ts
pnpm typecheck
pnpm build