Vibe Coding
返回 FastClaw

FastClaw / 能力层

插件

FastClaw 插件是 JSON-RPC subprocess,可以注册工具、Provider、Hook、Channel 能力,并通过 manifest 声明能力。

插件 核心概念信息图
插件 核心概念信息图

插件协议

插件通过子进程 JSON-RPC 与 FastClaw 通信。常见方法包括 initialize、shutdown、tool.list/execute、provider.list/execute、hook.register/fire、message.inbound、chat.send。

方法 作用
initialize / shutdown 生命周期
tool.list / tool.execute 暴露新工具
provider.list / provider.execute 暴露新模型 provider
hook.register / hook.fire 监听事件和注入行为
message.inbound / chat.send 接入渠道消息和回复

Manifest

插件 manifest 字段包括 id、name、version、description、type、command、capabilities、config。Gateway 会从 FASTCLAW_HOME/plugins 和配置路径发现插件。

{
  "id": "demo-tool",
  "name": "Demo Tool",
  "version": "0.1.0",
  "type": "subprocess",
  "command": ["node", "plugin.js"],
  "capabilities": ["tool"]
}

示例插件

源码自带 fastclaw-plugin-demo、mem0、openclaw-plugin-demo、post-turn-echo-demo 等示例,覆盖工具、hook、外部记忆和 OpenClaw 桥接。

凭据规则

provider 插件每次调用拿到 per-call credentials,插件不应该缓存密钥。