Repository navigation
v0.7.0 - Plugin System 🔌
🔌 Plugin System
用任意语言编写插件扩展 FastClaw,通过 JSON-RPC 协议通信。
插件类型
| 类型 | 用途 | 示例 |
|---|---|---|
| channel | 新增消息渠道 | 飞书、微信、LINE |
| tool | 新增 Agent 工具 | 图像生成、沙箱执行 |
| provider | 新增 LLM 提供商 | 自定义模型 |
| hook | 事件钩子 | 消息过滤、审计日志 |
工作原理
Gateway ←→ stdin/stdout JSON-RPC ←→ Plugin Process (Python/Node/Go/...)
- 插件是独立进程,崩溃自动重启(指数退避)
- Channel 插件无缝集成到消息路由
- Tool 插件自动注册到 Agent 工具列表
- 发现目录:
~/.fastclaw/plugins/
配置
{
"plugins": {
"enabled": true,
"entries": {
"feishu": {
"enabled": true,
"config": {"appId": "...", "appSecret": "..."}
}
}
}
}写一个插件
- 创建目录
~/.fastclaw/plugins/my-plugin/ - 写
plugin.json(声明 id/type/command) - 写插件代码(实现 JSON-RPC 协议)
fastclaw plugin list查看
附带示例:examples/plugins/echo/(Python echo 工具)
CLI
fastclaw plugin list # 查看插件
fastclaw plugin install ./my-plugin # 安装
fastclaw plugin remove my-plugin # 卸载Install / Update
fastclaw upgrade