openclaw/extensions/feishu/index.ts
wangchuang 902f89840c feat(channels): add Feishu/Lark channel integration
Add complete Feishu (Lark) channel plugin with WebSocket support for real-time messaging.

Features:
- Send and receive text messages in direct chats and group chats
- WebSocket-based event subscription (im.message.receive_v1)
- Multi-account support
- Interactive CLI onboarding (pnpm clawdbot channels add feishu)
- Optional encryption and verification token support

Implementation:
- Client wrapper for @larksuiteoapi/node-sdk
- Event dispatcher for message handling
- Account management and configuration
- Comprehensive README with setup guide and troubleshooting

Files:
- package.json, clawdbot.plugin.json: Plugin metadata and dependencies
- index.ts: Plugin entry point
- src/accounts.ts: Account resolution and validation
- src/channel.ts: Channel plugin and dock definitions
- src/client.ts: Feishu API client wrapper
- src/monitor.ts: WebSocket event monitoring
- src/onboarding.ts: Interactive CLI setup wizard
- src/runtime.ts: Runtime context management
- src/types.ts: TypeScript type definitions
- README.md: Configuration guide and documentation
2026-01-27 21:59:41 +08:00

19 lines
584 B
TypeScript

import type { ClawdbotPluginApi } from "clawdbot/plugin-sdk";
import { emptyPluginConfigSchema } from "clawdbot/plugin-sdk";
import { feishuDock, feishuPlugin } from "./src/channel.js";
import { setFeishuRuntime } from "./src/runtime.js";
const plugin = {
id: "feishu",
name: "Feishu",
description: "Clawdbot Feishu (Lark) channel plugin",
configSchema: emptyPluginConfigSchema(),
register(api: ClawdbotPluginApi) {
setFeishuRuntime(api.runtime);
api.registerChannel({ plugin: feishuPlugin, dock: feishuDock });
},
};
export default plugin;